Skip to content

Commit 0735a21

Browse files
Reuse user-event user in flex footer test
1 parent 3254e29 commit 0735a21

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/src/layouts/landing/footer.test.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import React from 'react';
2-
import userEvent, { UserEvent } from '@testing-library/user-event';
2+
import userEvent from '@testing-library/user-event';
33
import {render, screen, waitFor} from '@testing-library/preact';
44
import {describe, it} from '@jest/globals';
55
import { MemoryRouter } from 'react-router-dom';
66
import { useContactDialog } from '~/layouts/landing/footer/flex';
77

8+
const user = userEvent.setup({advanceTimers: jest.advanceTimersByTime});
9+
810
function ShowContactDialog(props: Parameters<ReturnType<typeof useContactDialog>['ContactDialog']>[0]) {
911
const {ContactDialog, open: openContactDialog} = useContactDialog();
1012

@@ -18,11 +20,8 @@ function ShowContactDialog(props: Parameters<ReturnType<typeof useContactDialog>
1820

1921
describe('flex landing footer', () => {
2022
describe('contact dialog', () => {
21-
let user: UserEvent;
22-
2323
beforeEach(() => {
2424
jest.useFakeTimers();
25-
user = userEvent.setup({advanceTimers: jest.advanceTimersByTime});
2625
});
2726

2827
it('opens and closes', async () => {

0 commit comments

Comments
 (0)