Skip to content

Commit

Permalink
refactor: 498 - add changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
KristiBo committed Sep 24, 2024
1 parent 0c761da commit f5ab196
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev-data/about-video.data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const video = {
export const videoTitleLocalized = {
en: { title: 'RS School video' },
ru: { title: 'Видео RS School' },
};
2 changes: 1 addition & 1 deletion dev-data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export { nodejs } from './nodejs.data';
export { preSchoolEn, preSchoolRu } from './preSchool.data';
export { reactEn } from './react-en.data';
export { reactRu } from './react-ru.data';
export { video } from './about-video.data';
export { videoTitleLocalized } from './about-video.data';
2 changes: 1 addition & 1 deletion src/widgets/about-video/ui/about-video.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

@include media-laptop-medium {
max-height: 411px;
max-height: 410px;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/widgets/about-video/ui/about-video.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { AboutVideo } from './about-video';
import { video } from 'data';
import { videoTitleLocalized } from 'data';

describe('AboutVideo component', () => {
it('renders without crashing with default title', () => {
Expand All @@ -10,14 +10,14 @@ describe('AboutVideo component', () => {

expect(aboutVideo).toBeVisible();
expect(title).toBeVisible();
expect(title).toHaveTextContent(video['en'].title);
expect(title).toHaveTextContent(videoTitleLocalized['en'].title);
});

it('displays the RU title correctly', () => {
render(<AboutVideo lang="ru" />);
const title = screen.getByTestId('widget-title');

expect(title).toHaveTextContent(video['ru'].title);
expect(title).toHaveTextContent(videoTitleLocalized['ru'].title);
});

it('renders the placeholder in development mode', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/about-video/ui/about-video.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames/bind';
import { WidgetTitle } from '@/shared/ui/widget-title';
import { video } from 'data';
import { videoTitleLocalized } from 'data';

import styles from './about-video.module.scss';

Expand All @@ -15,7 +15,7 @@ export const AboutVideo = ({ lang = 'en' }: AboutVideoProps) => {
return (
<section className={cx('container')} data-testid="about-video">
<article className={cx('content')}>
<WidgetTitle mods="lines">{video[lang].title}</WidgetTitle>
<WidgetTitle mods="lines">{videoTitleLocalized[lang].title}</WidgetTitle>
<div className={cx('video-wrapper')}>
<div className={cx('video-container')}>
{isRunningInDev
Expand Down

0 comments on commit f5ab196

Please sign in to comment.