diff --git a/src/__tests__/element-queries.js b/src/__tests__/element-queries.js index b9ad2ee0..8a8bc35f 100644 --- a/src/__tests__/element-queries.js +++ b/src/__tests__/element-queries.js @@ -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(`
`) expect(queryByTestId('firstName')).toBeTruthy() @@ -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', () => {