1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 12:13:45 +00:00

[PM-5189] Removing custom debounce method that is unused

This commit is contained in:
Cesar Gonzalez
2024-06-20 16:00:48 -05:00
parent 616118b6d8
commit 20dad3499f
2 changed files with 19 additions and 0 deletions

View File

@@ -424,6 +424,19 @@ describe("AutofillInlineMenuIframeService", () => {
forceClose: true,
});
});
it("triggers a fade in of the inline menu", () => {
jest.useFakeTimers();
jest.spyOn(globalThis, "clearTimeout");
autofillInlineMenuIframeService["fadeInTimeout"] = setTimeout(jest.fn, 10);
sendPortMessage(portSpy, { command: "fadeInAutofillInlineMenuIframe" });
expect(clearTimeout).toHaveBeenCalled();
expect(autofillInlineMenuIframeService["iframe"].style.opacity).toBe("0");
jest.advanceTimersByTime(10);
expect(autofillInlineMenuIframeService["iframe"].style.opacity).toBe("1");
});
});
});

View File

@@ -308,6 +308,9 @@ export class AutofillInlineMenuIframeService implements AutofillInlineMenuIframe
void this.sendExtensionMessage("closeAutofillInlineMenu", { forceClose: true });
}
/**
* Triggers a fade in effect for the inline menu iframe. Initialized by the background context.
*/
private handleFadeInInlineMenuIframe() {
this.clearFadeInTimeout();
this.fadeInTimeout = globalThis.setTimeout(() => {
@@ -315,6 +318,9 @@ export class AutofillInlineMenuIframeService implements AutofillInlineMenuIframe
}, 10);
}
/**
* Clears the fade in timeout for the inline menu iframe.
*/
private clearFadeInTimeout() {
if (this.fadeInTimeout) {
clearTimeout(this.fadeInTimeout);