Skip to content

Commit 8e64124

Browse files
author
叶文俊
committed
test: update unit tests
1 parent 5a55a01 commit 8e64124

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/Focus.spec.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,14 @@ describe('Focus', () => {
292292
// ================ check click ==============
293293
// click third item
294294
const item2 = getByTestId('2');
295+
const focusSpy2 = jest.spyOn(item2, 'focus').mockImplementation(() => {});
295296
fireEvent.click(item2);
296297
menuRef.current.focus();
297298
// mock focus on item 2 to make sure it gets focused
298-
expect(focusSpy).toHaveBeenCalled();
299+
expect(focusSpy2).toHaveBeenCalled();
299300
// cleanup
300301
focusSpy.mockRestore();
302+
focusSpy2.mockRestore();
301303
});
302304
});
303305
/* eslint-enable */

0 commit comments

Comments
 (0)