Skip to content

Commit

Permalink
fix(inputs): tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hebernardEquisoft committed Mar 25, 2024
1 parent 3362f28 commit 741e6dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/react/src/hooks/use-aria.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ describe('useAriaLabels hook', () => {
renderHook(() => useAriaLabels({}));
shallow(<TextInput />);

expect(console.warn).toHaveBeenCalledWith('Component is missing a label, aria-label, or aria-labelledby.');
expect(console.warn).toHaveBeenCalledTimes(2);
expect(consoleSpy).toHaveBeenCalledWith('Component is missing a label, aria-label, or aria-labelledby.');
expect(consoleSpy).toHaveBeenCalledTimes(2);
consoleSpy.mockRestore();
});

it('warns when more than one label type is provided', () => {
renderHook(() => useAriaLabels({ label: 'Test Label', ariaLabel: 'Test Aria Label' }));
shallow(<TextInput label="This is a label" ariaLabel="This is ariaLabel" />);

expect(console.warn).toHaveBeenCalledWith(
expect(consoleSpy).toHaveBeenCalledWith(
'Should not have more than one of label, aria-label, or aria-labelledby set.',
);
expect(console.warn).toHaveBeenCalledTimes(2);
expect(consoleSpy).toHaveBeenCalledTimes(2);
consoleSpy.mockRestore();
});

Expand Down

0 comments on commit 741e6dc

Please sign in to comment.