Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/__tests__/element-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ test('query/get select by text with multiple options selected', () => {
})

describe('query by test id', () => {
afterEach(() => {
// Restore the default test id attribute
// even if these tests failed
configure({testIdAttribute: 'data-testid'})
})

test('can get elements by test id', () => {
const {queryByTestId} = render(`<div data-testid="firstName"></div>`)
expect(queryByTestId('firstName')).toBeTruthy()
Expand All @@ -368,12 +374,6 @@ describe('query by test id', () => {
configure({testIdAttribute: 'something-else'})
expect(queryByTestId('theTestId')).toBeFalsy()
})

afterEach(() => {
// Restore the default test id attribute
// even if these tests failed
configure({testIdAttribute: 'data-testid'})
})
})

test('queryAllByRole returns semantic html elements', () => {
Expand Down