Skip to content

Commit 8628435

Browse files
MattAgnthymikee
MattAgn
authored andcommitted
test: add test for errors for byTestId
1 parent acbf466 commit 8628435

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/__tests__/byTestId.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ test('getByTestId, queryByTestId', () => {
129129

130130
expect(getByTestId('bananaFresh')).toBe(component);
131131
expect(queryByTestId('InExistent')).toBeNull();
132+
133+
expect(() => getByTestId('duplicateText')).toThrow(
134+
'Found multiple elements with testID: duplicateText'
135+
);
136+
expect(() => queryByTestId('duplicateText')).toThrow(
137+
'Found multiple elements with testID: duplicateText'
138+
);
132139
});
133140

134141
test('getAllByTestId, queryAllByTestId', () => {

0 commit comments

Comments
 (0)