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:
@@ -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");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user