@@ -73,19 +73,27 @@ describe('Axis', () => {
7373 const chart = await findChart ( ) ;
7474 expect ( chart ) . toBeInTheDocument ( ) ;
7575
76- expect ( screen . getByText ( 'Dec 2' ) ) . toBeInTheDocument ( ) ;
77- const timeLabels = screen . getAllByText ( / \d + : \d + : \d + [ A P ] M / ) ;
76+ // Check for minute-based time labels (primary label)
77+ const timeLabels = screen . getAllByText ( / \d + : \d + [ A P ] M / ) ;
7878 expect ( timeLabels . length ) . toBeGreaterThan ( 0 ) ;
79+
80+ // Check for second labels (secondary label)
81+ const secondLabels = screen . getAllByText ( / ^ \d { 1 , 2 } $ / ) ; // Just digits for seconds
82+ expect ( secondLabels . length ) . toBeGreaterThan ( 0 ) ;
7983 } ) ;
8084
8185 test ( 'Second renders properly' , async ( ) => {
8286 render ( < SecondGranularity { ...SecondGranularity . args } /> ) ;
8387 const chart = await findChart ( ) ;
8488 expect ( chart ) . toBeInTheDocument ( ) ;
8589
86- expect ( screen . getByText ( 'Dec 2' ) ) . toBeInTheDocument ( ) ;
87- const timeLabels = screen . getAllByText ( / \d + : \d + : \d + [ A P ] M / ) ;
90+ // Check for minute-based time labels (primary label)
91+ const timeLabels = screen . getAllByText ( / \d + : \d + [ A P ] M / ) ;
8892 expect ( timeLabels . length ) . toBeGreaterThan ( 0 ) ;
93+
94+ // Check for second labels (secondary label)
95+ const secondLabels = screen . getAllByText ( / ^ \d { 1 , 2 } $ / ) ; // Just digits for seconds
96+ expect ( secondLabels . length ) . toBeGreaterThan ( 0 ) ;
8997 } ) ;
9098
9199 test ( 'Minute renders properly' , async ( ) => {
@@ -162,10 +170,13 @@ describe('Axis', () => {
162170 const chart = await findChart ( ) ;
163171 expect ( chart ) . toBeInTheDocument ( ) ;
164172
165- // Day and time are in the same label for this configuration.
166- expect ( screen . getByText ( / D e c 2 .+ \d + : \d + : \d + [ A P ] M / ) ) . toBeInTheDocument ( ) ;
167- const timeLabels = screen . getAllByText ( / \d + : \d + : \d + [ A P ] M / ) ;
173+ // Check for time labels (minutes)
174+ const timeLabels = screen . getAllByText ( / \d + : \d + [ A P ] M / ) ;
168175 expect ( timeLabels . length ) . toBeGreaterThan ( 0 ) ;
176+
177+ // Check for second labels
178+ const secondLabels = screen . getAllByText ( / ^ \d { 1 , 2 } $ / ) ;
179+ expect ( secondLabels . length ) . toBeGreaterThan ( 0 ) ;
169180 } ) ;
170181
171182 test ( 'Minute renders properly' , async ( ) => {
0 commit comments