Skip to content

Commit

Permalink
test: add test for errors for byTestId
Browse files Browse the repository at this point in the history
  • Loading branch information
MattAgn authored and thymikee committed Feb 5, 2021
1 parent acbf466 commit 8628435
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/__tests__/byTestId.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ test('getByTestId, queryByTestId', () => {

expect(getByTestId('bananaFresh')).toBe(component);
expect(queryByTestId('InExistent')).toBeNull();

expect(() => getByTestId('duplicateText')).toThrow(
'Found multiple elements with testID: duplicateText'
);
expect(() => queryByTestId('duplicateText')).toThrow(
'Found multiple elements with testID: duplicateText'
);
});

test('getAllByTestId, queryAllByTestId', () => {
Expand Down

0 comments on commit 8628435

Please sign in to comment.