Skip to content

Commit

Permalink
[Security solution] Knowledge base tour video update (elastic#198158)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic authored Oct 29, 2024
1 parent 248119e commit a098aaa
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 a098aaa

Please sign in to comment.