Skip to content

Commit 792c68e

Browse files
authored
fix(datetimeinput): correct time-input label query in invalid-input tests (#3445)
The invalid-typed-time tests queried getByLabelText('Time'), but the time sub-input's accessible name is `${label} time` (e.g. 'Meeting time'). Align the 3 queries with the actual label so the suite passes.
1 parent 66ea6e3 commit 792c68e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/core/src/DateTimeInput/DateTimeInput.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ describe('DateTimeInput', () => {
486486
/>,
487487
);
488488

489-
const timeInput = screen.getByLabelText('Time');
489+
const timeInput = screen.getByLabelText('Meeting time');
490490
fireEvent.change(timeInput, {target: {value: '99:99 zz'}});
491491

492492
expect(timeInput).toHaveAttribute('aria-invalid', 'true');
@@ -501,7 +501,7 @@ describe('DateTimeInput', () => {
501501
/>,
502502
);
503503

504-
const timeInput = screen.getByLabelText('Time');
504+
const timeInput = screen.getByLabelText('Meeting time');
505505
fireEvent.change(timeInput, {target: {value: '3:45 pm'}});
506506

507507
expect(timeInput).not.toHaveAttribute('aria-invalid');
@@ -516,7 +516,7 @@ describe('DateTimeInput', () => {
516516
/>,
517517
);
518518

519-
const timeInput = screen.getByLabelText('Time');
519+
const timeInput = screen.getByLabelText('Meeting time');
520520
fireEvent.change(timeInput, {target: {value: '99:99 zz'}});
521521

522522
expect(screen.getByText('Invalid time')).toBeInTheDocument();

0 commit comments

Comments
 (0)