Skip to content

Commit

Permalink
[8.16] [Security solution] Knowledge base tour video update (#198158) (
Browse files Browse the repository at this point in the history
…#198228)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security solution] Knowledge base tour video update
(#198158)](#198158)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-29T23:17:24Z","message":"[Security
solution] Knowledge base tour video update
(#198158)","sha":"a098aaaac798d5158deccb21b00e60e41ea71d54","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","💝community","v9.0.0","Team:
SecuritySolution","Team:Security Generative
AI","v8.16.0","backport:version","v8.17.0"],"title":"[Security solution]
Knowledge base tour video
update","number":198158,"url":"https://github.com/elastic/kibana/pull/198158","mergeCommit":{"message":"[Security
solution] Knowledge base tour video update
(#198158)","sha":"a098aaaac798d5158deccb21b00e60e41ea71d54"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198158","number":198158,"mergeCommit":{"message":"[Security
solution] Knowledge base tour video update
(#198158)","sha":"a098aaaac798d5158deccb21b00e60e41ea71d54"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <[email protected]>
  • Loading branch information
kibanamachine and stephmilovic authored Oct 30, 2024
1 parent 7578b6d commit 45b0ead
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { VideoToast } from './video_toast';
import { VIDEO_PAGE, VideoToast } from './video_toast';

describe('VideoToast', () => {
const onCloseMock = jest.fn();
Expand All @@ -32,19 +32,13 @@ describe('VideoToast', () => {
it('should open the video in a new tab when the gif is clicked', async () => {
const videoGif = screen.getByTestId('video-gif');
await userEvent.click(videoGif);
expect(window.open).toHaveBeenCalledWith(
'https://videos.elastic.co/watch/BrDaDBAAvdygvemFKNAkBW',
'_blank'
);
expect(window.open).toHaveBeenCalledWith(VIDEO_PAGE, '_blank');
});

it('should open the video in a new tab when the "Watch overview video" button is clicked', async () => {
const watchVideoButton = screen.getByRole('button', { name: 'Watch overview video' });
await userEvent.click(watchVideoButton);
expect(window.open).toHaveBeenCalledWith(
'https://videos.elastic.co/watch/BrDaDBAAvdygvemFKNAkBW',
'_blank'
);
expect(window.open).toHaveBeenCalledWith(VIDEO_PAGE, '_blank');
});

it('should call the onClose callback when the close button is clicked', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ import React, { useCallback } from 'react';
import * as i18n from './translations';
import theGif from './overview.gif';

const VIDEO_CONTENT_WIDTH = 250;
// TODO before removing assistantKnowledgeBaseByDefault feature flag
// update the VIDEO_PAGE to the correct URL
const VIDEO_PAGE = `https://videos.elastic.co/watch/BrDaDBAAvdygvemFKNAkBW`;
const VIDEO_CONTENT_WIDTH = 330;
export const VIDEO_PAGE = `https://ela.st/seckb`;

const VideoComponent: React.FC<{ onClose: () => void }> = ({ onClose }) => {
const openVideoInNewTab = useCallback(() => {
Expand Down

0 comments on commit 45b0ead

Please sign in to comment.