diff --git a/website/src/components/onboarding-modal.test.js b/website/src/components/onboarding-modal.test.js
index cf56fec..577122d 100644
--- a/website/src/components/onboarding-modal.test.js
+++ b/website/src/components/onboarding-modal.test.js
@@ -8,32 +8,17 @@ import {
} from './onboarding-modal.js'
describe('onboarding-modal', () => {
- let originalMatchMedia
-
beforeEach(() => {
localStorage.clear()
i18n.init()
// Note: innerHTML usage here is in test code only, not production.
// The test DOM is reset between tests and contains no user input.
document.body.innerHTML = ''
- // Mock matchMedia - default to desktop (min-width: 640px matches)
- originalMatchMedia = window.matchMedia
- window.matchMedia = (query) => ({
- matches: query === '(min-width: 640px)',
- media: query,
- onchange: null,
- addListener: () => {},
- removeListener: () => {},
- addEventListener: () => {},
- removeEventListener: () => {},
- dispatchEvent: () => false,
- })
})
afterEach(() => {
document.body.innerHTML = ''
document.body.style.overflow = ''
- window.matchMedia = originalMatchMedia
})
describe('shouldShowOnboarding', () => {
@@ -83,7 +68,7 @@ describe('onboarding-modal', () => {
expect(modal.textContent).toContain('One word, and the AI gets the rest.')
})
- it('contains the YouTube embed for desktop', () => {
+ it('contains the YouTube embed', () => {
createOnboardingModal()
showOnboarding()
@@ -101,25 +86,13 @@ describe('onboarding-modal', () => {
expect(iframe.src).toContain('youtube.com/embed/cp-qqiHU-MA')
})
- it('contains YouTube link on mobile instead of iframe', () => {
- window.matchMedia = (query) => ({
- matches: false,
- media: query,
- onchange: null,
- addListener: () => {},
- removeListener: () => {},
- addEventListener: () => {},
- removeEventListener: () => {},
- dispatchEvent: () => false,
- })
+ it('always embeds video iframe regardless of screen size', () => {
createOnboardingModal()
showOnboarding()
- const link = document.querySelector('#onboarding-modal a[href*="youtube.com/shorts"]')
- expect(link).toBeTruthy()
- expect(link.getAttribute('target')).toBe('_blank')
const iframe = document.querySelector('#onboarding-modal iframe')
- expect(iframe).toBeNull()
+ expect(iframe).toBeTruthy()
+ expect(iframe.src).toContain('youtube.com/embed/')
})
})