1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-13 01:58:44 +02:00

[PM-6426] Fixing generate password to clipboard command jest tests

This commit is contained in:
Cesar Gonzalez 2024-04-30 10:38:09 -05:00
parent 86d273df46
commit cb4051f704
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF

View File

@ -26,7 +26,13 @@ describe("GeneratePasswordToClipboardCommand", () => {
passwordGenerationService = mock<PasswordGenerationServiceAbstraction>();
autofillSettingsService = mock<AutofillSettingsService>();
browserTaskSchedulerService = mock<BrowserTaskSchedulerService>({
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]);