Skip to content

Commit a0e3104

Browse files
committed
test(Spinner): assert accessible name instead of aria-label attribute
Use toHaveAccessibleName for the aria-label-with-aria-labelledby case, per review - the accessible-name check is sufficient to confirm the expected value.
1 parent fc9e371 commit a0e3104

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-core/src/components/Spinner/__tests__/Spinner.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test('Renders with accessible name via aria-labelledby when passed', () => {
2929

3030
test('Renders with aria-label even when aria-labelledby is passed', () => {
3131
render(<Spinner aria-labelledby="external-label" />);
32-
expect(screen.getByRole('progressbar')).toHaveAttribute('aria-label', 'Contents');
32+
expect(screen.getByRole('progressbar')).toHaveAccessibleName('Contents');
3333
});
3434

3535
test('small spinner', () => {

0 commit comments

Comments
 (0)