Skip to content

Commit 077c54d

Browse files
committed
chore: remove not needed condition
1 parent bcaaee3 commit 077c54d

File tree

1 file changed

+0
-92
lines changed

1 file changed

+0
-92
lines changed

test/e2e/app-header.spec.ts

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ test.describe('Mobile Header Menu', () => {
8181
test('menu is closed by default on page load', async ({ page, goto }) => {
8282
await goto('/', { waitUntil: 'hydration' })
8383

84-
const isOnMobile = await isMobileViewport(page)
85-
if (!isOnMobile) {
86-
test.skip()
87-
}
88-
8984
// Menu button should be visible
9085
const menuButton = page
9186
.locator(
@@ -101,11 +96,6 @@ test.describe('Mobile Header Menu', () => {
10196
test('menu button has aria-expanded="false" by default', async ({ page, goto }) => {
10297
await goto('/compare', { waitUntil: 'hydration' })
10398

104-
const isOnMobile = await isMobileViewport(page)
105-
if (!isOnMobile) {
106-
test.skip()
107-
}
108-
10999
const menuButton = page
110100
.locator(
111101
'button[aria-label*="open_menu"], button[aria-label*="Buka"], button[aria-label*="Apri"], button[aria-label*="Otevřít"], button[aria-label*="Ouvrir"]',
@@ -119,11 +109,6 @@ test.describe('Mobile Header Menu', () => {
119109
test('menu opens when clicking the menu button', async ({ page, goto }) => {
120110
await goto('/', { waitUntil: 'hydration' })
121111

122-
const isOnMobile = await isMobileViewport(page)
123-
if (!isOnMobile) {
124-
test.skip()
125-
}
126-
127112
await expectMenuClosed(page)
128113

129114
// Click menu button to open
@@ -136,11 +121,6 @@ test.describe('Mobile Header Menu', () => {
136121
test('menu closes when clicking the menu button again', async ({ page, goto }) => {
137122
await goto('/', { waitUntil: 'hydration' })
138123

139-
const isOnMobile = await isMobileViewport(page)
140-
if (!isOnMobile) {
141-
test.skip()
142-
}
143-
144124
// Open menu
145125
await openMobileMenu(page)
146126
await expectMenuOpen(page)
@@ -160,11 +140,6 @@ test.describe('Mobile Header Menu', () => {
160140
test('menu closes when clicking the close button', async ({ page, goto }) => {
161141
await goto('/', { waitUntil: 'hydration' })
162142

163-
const isOnMobile = await isMobileViewport(page)
164-
if (!isOnMobile) {
165-
test.skip()
166-
}
167-
168143
// Open menu
169144
await openMobileMenu(page)
170145
await expectMenuOpen(page)
@@ -179,11 +154,6 @@ test.describe('Mobile Header Menu', () => {
179154
test('menu closes when clicking the backdrop', async ({ page, goto }) => {
180155
await goto('/', { waitUntil: 'hydration' })
181156

182-
const isOnMobile = await isMobileViewport(page)
183-
if (!isOnMobile) {
184-
test.skip()
185-
}
186-
187157
// Open menu
188158
await openMobileMenu(page)
189159
await expectMenuOpen(page)
@@ -199,11 +169,6 @@ test.describe('Mobile Header Menu', () => {
199169
test('menu button aria-expanded toggles with menu state', async ({ page, goto }) => {
200170
await goto('/', { waitUntil: 'hydration' })
201171

202-
const isOnMobile = await isMobileViewport(page)
203-
if (!isOnMobile) {
204-
test.skip()
205-
}
206-
207172
const menuButton = page
208173
.locator(
209174
'button[aria-label*="open_menu"], button[aria-label*="Buka"], button[aria-label*="Apri"], button[aria-label*="Otevřít"], button[aria-label*="Ouvrir"]',
@@ -227,11 +192,6 @@ test.describe('Mobile Header Menu', () => {
227192
test('Escape key closes the menu', async ({ page, goto }) => {
228193
await goto('/', { waitUntil: 'hydration' })
229194

230-
const isOnMobile = await isMobileViewport(page)
231-
if (!isOnMobile) {
232-
test.skip()
233-
}
234-
235195
// Open menu
236196
await openMobileMenu(page)
237197
await expectMenuOpen(page)
@@ -246,11 +206,6 @@ test.describe('Mobile Header Menu', () => {
246206
test('focus trap is active when menu is open', async ({ page, goto }) => {
247207
await goto('/', { waitUntil: 'hydration' })
248208

249-
const isOnMobile = await isMobileViewport(page)
250-
if (!isOnMobile) {
251-
test.skip()
252-
}
253-
254209
// Open menu
255210
await openMobileMenu(page)
256211
await expectMenuOpen(page)
@@ -278,11 +233,6 @@ test.describe('Mobile Header Menu', () => {
278233
test('menu closes when navigating to a different route', async ({ page, goto }) => {
279234
await goto('/', { waitUntil: 'hydration' })
280235

281-
const isOnMobile = await isMobileViewport(page)
282-
if (!isOnMobile) {
283-
test.skip()
284-
}
285-
286236
// Open menu
287237
await openMobileMenu(page)
288238
await expectMenuOpen(page)
@@ -301,11 +251,6 @@ test.describe('Mobile Header Menu', () => {
301251
test('menu closes when searching (debounced navigation)', async ({ page, goto }) => {
302252
await goto('/', { waitUntil: 'hydration' })
303253

304-
const isOnMobile = await isMobileViewport(page)
305-
if (!isOnMobile) {
306-
test.skip()
307-
}
308-
309254
// Open menu
310255
await openMobileMenu(page)
311256
await expectMenuOpen(page)
@@ -327,11 +272,6 @@ test.describe('Mobile Header Menu', () => {
327272
test('menu has correct ARIA attributes', async ({ page, goto }) => {
328273
await goto('/', { waitUntil: 'hydration' })
329274

330-
const isOnMobile = await isMobileViewport(page)
331-
if (!isOnMobile) {
332-
test.skip()
333-
}
334-
335275
// Open menu
336276
await openMobileMenu(page)
337277

@@ -345,11 +285,6 @@ test.describe('Mobile Header Menu', () => {
345285
test('close button has proper accessibility label', async ({ page, goto }) => {
346286
await goto('/', { waitUntil: 'hydration' })
347287

348-
const isOnMobile = await isMobileViewport(page)
349-
if (!isOnMobile) {
350-
test.skip()
351-
}
352-
353288
// Open menu
354289
await openMobileMenu(page)
355290

@@ -364,11 +299,6 @@ test.describe('Mobile Header Menu', () => {
364299
test('menu items are keyboard navigable', async ({ page, goto }) => {
365300
await goto('/', { waitUntil: 'hydration' })
366301

367-
const isOnMobile = await isMobileViewport(page)
368-
if (!isOnMobile) {
369-
test.skip()
370-
}
371-
372302
// Open menu
373303
await openMobileMenu(page)
374304
await expectMenuOpen(page)
@@ -393,11 +323,6 @@ test.describe('Mobile Header Menu', () => {
393323
test('helper functions work independently - expectMenuClosed', async ({ page, goto }) => {
394324
await goto('/', { waitUntil: 'hydration' })
395325

396-
const isOnMobile = await isMobileViewport(page)
397-
if (!isOnMobile) {
398-
test.skip()
399-
}
400-
401326
// Should not throw - menu is closed by default
402327
await expectMenuClosed(page)
403328
})
@@ -418,11 +343,6 @@ test.describe('Mobile Header Menu', () => {
418343
test('helper functions work independently - closeMobileMenu', async ({ page, goto }) => {
419344
await goto('/', { waitUntil: 'hydration' })
420345

421-
const isOnMobile = await isMobileViewport(page)
422-
if (!isOnMobile) {
423-
test.skip()
424-
}
425-
426346
// Open and then use helper to close
427347
await openMobileMenu(page)
428348
await closeMobileMenu(page)
@@ -432,11 +352,6 @@ test.describe('Mobile Header Menu', () => {
432352
test('helpers can be combined in sequence', async ({ page, goto }) => {
433353
await goto('/', { waitUntil: 'hydration' })
434354

435-
const isOnMobile = await isMobileViewport(page)
436-
if (!isOnMobile) {
437-
test.skip()
438-
}
439-
440355
// Test sequence: closed -> open -> closed -> open
441356
await expectMenuClosed(page)
442357
await openMobileMenu(page)
@@ -446,12 +361,5 @@ test.describe('Mobile Header Menu', () => {
446361
await openMobileMenu(page)
447362
await expectMenuOpen(page)
448363
})
449-
450-
test('isMobileViewport helper works correctly', async ({ page, goto }) => {
451-
await goto('/', { waitUntil: 'hydration' })
452-
453-
const isMobile = await isMobileViewport(page)
454-
expect(isMobile).toBe(true)
455-
})
456364
})
457365
})

0 commit comments

Comments
 (0)