test: Remove delay for .upload user method

This sets delay to null for `uploadFile` helper, meaning there's no delay for the `.upload` user method now.
This commit is contained in:
regexowl 2025-07-28 10:57:19 +02:00 committed by Gianluca Zuccarelli
parent f4e872548c
commit 9f3ad99037

View file

@ -108,7 +108,7 @@ const addSatelliteRegistrationCommandViaKeyDown = async (command: string) => {
};
const uploadFile = async (scriptName: string): Promise<void> => {
const user = userEvent.setup();
const user = userEvent.setup({ delay: null});
const fileInput: HTMLElement | null =
// eslint-disable-next-line testing-library/no-node-access
document.querySelector('input[type="file"]');
@ -432,7 +432,7 @@ describe('Registration request generated correctly', () => {
expect(nextButton).toBeDisabled();
await uploadFile(CERTIFICATE);
expect(nextButton).toBeDisabled();
await waitFor(() => expect(nextButton).toBeDisabled());
await addSatelliteRegistrationCommandViaKeyDown(
SATELLITE_COMMAND_EXPIRED_TOKEN
);
@ -443,11 +443,11 @@ describe('Registration request generated correctly', () => {
await waitFor(() => expect(expiredTokenHelper).toBeInTheDocument());
await addSatelliteRegistrationCommandViaKeyDown(SATELLITE_COMMAND);
expect(nextButton).toBeEnabled();
await waitFor(() => expect(nextButton).toBeEnabled());
await addSatelliteRegistrationCommandViaKeyDown(
SATELLITE_COMMAND_NO_EXPIRATION
);
expect(nextButton).toBeEnabled();
await waitFor(() => expect(nextButton).toBeEnabled());
});
});