@@ -26,10 +26,11 @@ test.describe('Timer Behavior', () => {
2626 const timerDisplay = page . locator ( '[role="timer"]' )
2727 await expect ( timerDisplay ) . toContainText ( '05:00' )
2828
29- const minutesInput = page . getByRole ( 'spinbutton' , { name : / m i n u t e s / i } )
30- const secondsInput = page . getByRole ( 'spinbutton' , { name : / s e c o n d s / i } )
31- await expect ( minutesInput ) . toHaveValue ( '5' )
32- await expect ( secondsInput ) . toHaveValue ( '0' )
29+ const minutesInput = page . getByTestId ( 'time-input-minutes' )
30+ const secondsInput = page . getByTestId ( 'time-input-seconds' )
31+ // GlassNumberStepper displays values with leading zeros
32+ await expect ( minutesInput ) . toHaveValue ( '05' )
33+ await expect ( secondsInput ) . toHaveValue ( '00' )
3334
3435 // Test persisted state (6 minutes in localStorage)
3536 await page . evaluate ( ( ) => {
@@ -53,8 +54,8 @@ test.describe('Timer Behavior', () => {
5354 await expect ( timerDisplay ) . toContainText ( '06:00' )
5455
5556 // Wait for inputs to sync with persisted timer state (hydration + useEffect)
56- await expect ( minutesInput ) . toHaveValue ( '6 ' , { timeout : 2000 } )
57- await expect ( secondsInput ) . toHaveValue ( '0 ' )
57+ await expect ( minutesInput ) . toHaveValue ( '06 ' , { timeout : 2000 } )
58+ await expect ( secondsInput ) . toHaveValue ( '00 ' )
5859
5960 // Clean up
6061 await page . evaluate ( ( ) => localStorage . clear ( ) )
@@ -66,7 +67,7 @@ test.describe('Timer Behavior', () => {
6667 await page . goto ( '/en' )
6768 await page . waitForLoadState ( 'networkidle' )
6869
69- const minutesInput = page . getByRole ( 'spinbutton' , { name : / m i n u t e s / i } )
70+ const minutesInput = page . getByTestId ( 'time-input- minutes' )
7071 const timerDisplay = page . locator ( '[role="timer"]' )
7172
7273 await minutesInput . click ( )
@@ -98,8 +99,8 @@ test.describe('Timer Behavior', () => {
9899 await expect ( timerDisplay ) . toContainText ( '05:00' )
99100
100101 // Set timer to 0:0 manually
101- const minutesInput = page . getByRole ( 'spinbutton' , { name : / m i n u t e s / i } )
102- const secondsInput = page . getByRole ( 'spinbutton' , { name : / s e c o n d s / i } )
102+ const minutesInput = page . getByTestId ( 'time-input- minutes' )
103+ const secondsInput = page . getByTestId ( 'time-input- seconds' )
103104
104105 await minutesInput . click ( )
105106 await minutesInput . fill ( '0' )
@@ -133,8 +134,8 @@ test.describe('Timer Behavior', () => {
133134 await page . waitForTimeout ( 1000 )
134135
135136 // Set a short timer (2 seconds for faster test)
136- const minutesInput = page . getByRole ( 'spinbutton' , { name : / m i n u t e s / i } )
137- const secondsInput = page . getByRole ( 'spinbutton' , { name : / s e c o n d s / i } )
137+ const minutesInput = page . getByTestId ( 'time-input- minutes' )
138+ const secondsInput = page . getByTestId ( 'time-input- seconds' )
138139
139140 await minutesInput . click ( )
140141 await minutesInput . fill ( '0' )
@@ -219,8 +220,8 @@ test.describe('Timer Behavior', () => {
219220 } )
220221
221222 // Set a short timer (2 seconds)
222- const minutesInput = page . getByRole ( 'spinbutton' , { name : / m i n u t e s / i } )
223- const secondsInput = page . getByRole ( 'spinbutton' , { name : / s e c o n d s / i } )
223+ const minutesInput = page . getByTestId ( 'time-input- minutes' )
224+ const secondsInput = page . getByTestId ( 'time-input- seconds' )
224225
225226 await minutesInput . fill ( '0' )
226227 await secondsInput . fill ( '2' )
@@ -249,8 +250,8 @@ test.describe('Timer Behavior', () => {
249250 await page . waitForTimeout ( 1000 )
250251
251252 // Set a 3 second timer
252- const minutesInput = page . getByRole ( 'spinbutton' , { name : / m i n u t e s / i } )
253- const secondsInput = page . getByRole ( 'spinbutton' , { name : / s e c o n d s / i } )
253+ const minutesInput = page . getByTestId ( 'time-input- minutes' )
254+ const secondsInput = page . getByTestId ( 'time-input- seconds' )
254255
255256 await minutesInput . fill ( '0' )
256257 await secondsInput . fill ( '3' )
@@ -294,8 +295,8 @@ test.describe('Timer Behavior', () => {
294295 await page . waitForTimeout ( 1000 )
295296
296297 // Set timer to 0:0 first
297- const minutesInput = page . getByRole ( 'spinbutton' , { name : / m i n u t e s / i } )
298- const secondsInput = page . getByRole ( 'spinbutton' , { name : / s e c o n d s / i } )
298+ const minutesInput = page . getByTestId ( 'time-input- minutes' )
299+ const secondsInput = page . getByTestId ( 'time-input- seconds' )
299300
300301 await minutesInput . fill ( '0' )
301302 await secondsInput . fill ( '0' )
0 commit comments