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

628-fix: Video placeholder shown on prod #629

Merged
merged 1 commit into from
Nov 4, 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
4 changes: 0 additions & 4 deletions .env

This file was deleted.

3 changes: 0 additions & 3 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export const TABLET_W = Number(process.env.NEXT_PUBLIC_TABLET);
export const MOBILE_W = Number(process.env.NEXT_PUBLIC_MOBILE);
export const DESKTOP_W = 1280;
export const RS_INTRO_URL = 'https://www.youtube.com/embed/n4unZLVpnaU';
export const RS_FOUNDATION_YEAR = '2013';

Expand Down
9 changes: 0 additions & 9 deletions src/shared/helpers/generateSizes.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/shared/helpers/generateSrcSet.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/widgets/about-video/ui/about-video.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ describe('AboutVideo component', () => {
});

it('renders the placeholder in development mode', () => {
vi.stubEnv('NEXT_PUBLIC_DEV', 'true');
vi.stubEnv('NODE_ENV', 'development');
render(<AboutVideo />);
const placeholder = screen.getByText('Video Placeholder');

expect(placeholder).toBeVisible();
});

it('renders the YouTube embed in production mode', () => {
vi.stubEnv('NEXT_PUBLIC_DEV', 'false');
vi.stubEnv('NODE_ENV', 'production');
render(<AboutVideo />);
const video = screen.getByTitle('Introduction to The Rolling Scopes School Online Courses');

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/about-video/ui/about-video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type AboutVideoProps = { lang?: 'en' | 'ru' };

export const AboutVideo = ({ lang = 'en' }: AboutVideoProps) => {
// Needed to prevent flakiness in screenshot tests
const isRunningInDev = process.env.NEXT_PUBLIC_DEV === 'true';
const isRunningInDev = process.env.NODE_ENV === 'development';

return (
<section className={cx('container')} data-testid="about-video">
Expand Down
Loading