@@ -3,8 +3,6 @@ import { test } from './fixtures'
33import {
44 setupMinimalVisualRegressionTest ,
55 mockSpotifyPlaybackState ,
6- mockLoggedInSession ,
7- resetServerState ,
86 getSpotifyMasks ,
97} from './lib'
108import { checkAccessibility } from './lib/accessibility'
@@ -13,22 +11,20 @@ import { waitForPageReady, waitForWebSocketConnection } from './lib/waits'
1311import { VRT_TIMEOUTS } from './lib/timeouts'
1412
1513test . describe ( 'Component-Specific VRT' , ( ) => {
16- test . beforeEach ( async ( { dashboardPage, request } ) => {
17- await resetServerState ( request )
18- await setupMinimalVisualRegressionTest ( dashboardPage , '/' )
19- } )
20-
2114 test ( 'BottomNavBar highlights correct icon' , async ( { dashboardPage } ) => {
15+ await setupMinimalVisualRegressionTest ( dashboardPage , '/' )
2216 const bottomNav = dashboardPage . getByTestId ( 'bottom-nav-bar' )
2317 await takeScreenshot ( bottomNav , 'bottom-nav-bar.png' )
2418 } )
2519
2620 test ( 'Footer rendering' , async ( { dashboardPage } ) => {
21+ await setupMinimalVisualRegressionTest ( dashboardPage , '/' )
2722 const footer = dashboardPage . getByTestId ( 'footer' )
2823 await takeScreenshot ( footer , 'footer.png' )
2924 } )
3025
3126 test ( 'LoadingIndicator visibility' , async ( { dashboardPage } ) => {
27+ await setupMinimalVisualRegressionTest ( dashboardPage , '/' )
3228 // Force visibility and pause animation for VRT
3329 await dashboardPage . evaluate ( ( ) => {
3430 const el = document . querySelector (
@@ -87,11 +83,8 @@ test.describe('Component-Specific VRT', () => {
8783 await takeScreenshot ( tableHeader , 'workout-table-header.png' )
8884 } )
8985
90- test ( 'SpotifyDeviceSelector menu' , async ( { dashboardPage, context } ) => {
91- // Mock session to appear logged in
92- await mockLoggedInSession ( context )
93- await dashboardPage . reload ( )
94- await waitForPageReady ( dashboardPage )
86+ test ( 'SpotifyDeviceSelector menu' , async ( { dashboardPage } ) => {
87+ await setupMinimalVisualRegressionTest ( dashboardPage , '/' )
9588
9689 // Wait for the WebSocket to fully reconnect after the reload
9790 // before applying mocks, otherwise the server's initial STATE_SYNC
@@ -162,6 +155,7 @@ test.describe('Component-Specific VRT', () => {
162155 } )
163156
164157 test ( 'RefreshIconButton states' , async ( { dashboardPage } ) => {
158+ await setupMinimalVisualRegressionTest ( dashboardPage , '/' )
165159 const refreshButton = dashboardPage . getByTestId ( 'refresh-icon-button' )
166160 await takeScreenshot ( refreshButton , 'refresh-icon-button.png' )
167161 await refreshButton . hover ( )
0 commit comments