diff --git a/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.spec.ts b/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.spec.ts index b64f5da561..e74292563e 100644 --- a/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.spec.ts +++ b/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.spec.ts @@ -26,7 +26,13 @@ describe("GeneratePasswordToClipboardCommand", () => { passwordGenerationService = mock(); autofillSettingsService = mock(); browserTaskSchedulerService = mock({ - setTimeout: jest.fn(async (callback, timeoutInMs) => setTimeout(callback, timeoutInMs)), + setTimeout: jest.fn(async (taskName, timeoutInMs) => + setTimeout(() => { + if (taskName === ScheduledTaskNames.generatePasswordClearClipboardTimeout) { + void ClearClipboard.run(); + } + }, timeoutInMs), + ), }); passwordGenerationService.getOptions.mockResolvedValue([{ length: 8 }, {} as any]);