Skip to content

Commit 7906ad5

Browse files
mmantelKent C. Dodds
authored andcommitted
chore: Fix lint error from jest/prefer-hooks-on-top (#388)
1 parent da7a844 commit 7906ad5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/__tests__/element-queries.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ test('query/get select by text with multiple options selected', () => {
347347
})
348348

349349
describe('query by test id', () => {
350+
afterEach(() => {
351+
// Restore the default test id attribute
352+
// even if these tests failed
353+
configure({testIdAttribute: 'data-testid'})
354+
})
355+
350356
test('can get elements by test id', () => {
351357
const {queryByTestId} = render(`<div data-testid="firstName"></div>`)
352358
expect(queryByTestId('firstName')).toBeTruthy()
@@ -368,12 +374,6 @@ describe('query by test id', () => {
368374
configure({testIdAttribute: 'something-else'})
369375
expect(queryByTestId('theTestId')).toBeFalsy()
370376
})
371-
372-
afterEach(() => {
373-
// Restore the default test id attribute
374-
// even if these tests failed
375-
configure({testIdAttribute: 'data-testid'})
376-
})
377377
})
378378

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

0 commit comments

Comments
 (0)