E57A test(packages/renderer): make test run faster to avoid blocking ci · podman-desktop/podman-desktop@cc989cd · GitHub
[go: up one dir, main page]

Skip to content

Commit cc989cd

Browse files
committed
test(packages/renderer): make test run faster to avoid blocking ci
Signed-off-by: Simon Rey <sfbrey+eqqe@gmail.com>
1 parent 158482a commit cc989cd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/renderer/src/lib/troubleshooting/TroubleshootingRepairCleanup.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ test('Check cleanupProviders is called and button is in progress', async () => {
4343
const cleanupButton = screen.getByRole('button', { name: 'Cleanup' });
4444
expect(cleanupButton).toBeInTheDocument();
4545

46-
// mock the cleanup as waiting for 2 seconds
47-
cleanupProvidersMock.mockResolvedValue(new Promise(resolve => setTimeout(resolve, 2000)));
46+
// mock the cleanup as waiting for 10ms
47+
cleanupProvidersMock.mockResolvedValue(new Promise(resolve => setTimeout(resolve, 10)));
4848

4949
// click on the cleanup button
5050
expect(cleanupButton).toBeEnabled();
5151
await fireEvent.click(cleanupButton);
5252

5353
// wait next tick
54-
await new Promise(resolve => setTimeout(resolve, 100));
54+
await new Promise(resolve => setTimeout(resolve, 5));
5555

5656
// button should be in progress
5757
expect(cleanupButton).toBeDisabled();
5858
// svg should be inside the button
5959
const svg = cleanupButton.querySelector('svg');
6060
expect(svg).toBeInTheDocument();
6161

62-
// wait 2s for the cleanup to finish
63-
await new Promise(resolve => setTimeout(resolve, 2000));
62+
// wait 10ms for the cleanup to finish
63+
await new Promise(resolve => setTimeout(resolve, 10));
6464

6565
// button should not be in progress anymore
6666
expect(cleanupButton).toBeEnabled();

0 commit comments

Comments
 (0)
0