Skip to content

Commit 6842b42

Browse files
committed
restore mocks in afterEach
1 parent c9dc667 commit 6842b42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react/src/hooks/useTabs.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ const mockKeyboardEvent = (key: string) =>
6666
} as unknown as React.KeyboardEvent<HTMLElement>)
6767

6868
describe('useTabs', () => {
69+
afterEach(() => {
70+
jest.restoreAllMocks()
71+
})
72+
6973
it('returns an object with the expected shape', () => {
7074
const {result} = renderUseTabsHook()
7175

@@ -1094,8 +1098,6 @@ describe('useTabs', () => {
10941098
})
10951099

10961100
expect(focusSpy).toHaveBeenCalledTimes(1)
1097-
1098-
focusSpy.mockRestore()
10991101
})
11001102

11011103
it('calls element.focus() when keyboard navigation occurs', () => {
@@ -1117,8 +1119,6 @@ describe('useTabs', () => {
11171119
})
11181120

11191121
expect(focusSpy).toHaveBeenCalledTimes(1)
1120-
1121-
focusSpy.mockRestore()
11221122
})
11231123

11241124
it('calls preventDefault on arrow key events', () => {

0 commit comments

Comments
 (0)