Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security solution] Knowledge base tour video update #198158

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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