1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-15 01:11:47 +01:00

[PM-5189] Implementing jest tests for AutofillInlineMenuContentService

This commit is contained in:
Cesar Gonzalez 2024-06-11 13:35:19 -05:00
parent eaeb4e46e9
commit 644dbe251b
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF

View File

@ -9,12 +9,12 @@ import {
} from "../../abstractions/autofill-inline-menu-container"; } from "../../abstractions/autofill-inline-menu-container";
export class AutofillInlineMenuContainer { export class AutofillInlineMenuContainer {
private setElementStyles = setElementStyles; private readonly setElementStyles = setElementStyles;
private extensionOriginsSet: Set<string>; private readonly extensionOriginsSet: Set<string>;
private port: chrome.runtime.Port | null = null; private port: chrome.runtime.Port | null = null;
private portName: string; private portName: string;
private inlineMenuPageIframe: HTMLIFrameElement; private inlineMenuPageIframe: HTMLIFrameElement;
private iframeStyles: Partial<CSSStyleDeclaration> = { private readonly iframeStyles: Partial<CSSStyleDeclaration> = {
all: "initial", all: "initial",
position: "fixed", position: "fixed",
top: "0", top: "0",
@ -32,14 +32,14 @@ export class AutofillInlineMenuContainer {
padding: "0", padding: "0",
colorScheme: "normal", colorScheme: "normal",
}; };
private defaultIframeAttributes: Record<string, string> = { private readonly defaultIframeAttributes: Record<string, string> = {
src: "", src: "",
title: "", title: "",
sandbox: "allow-scripts", sandbox: "allow-scripts",
allowtransparency: "true", allowtransparency: "true",
tabIndex: "-1", tabIndex: "-1",
}; };
private windowMessageHandlers: AutofillInlineMenuContainerWindowMessageHandlers = { private readonly windowMessageHandlers: AutofillInlineMenuContainerWindowMessageHandlers = {
initAutofillInlineMenuButton: (message) => this.handleInitInlineMenuIframe(message), initAutofillInlineMenuButton: (message) => this.handleInitInlineMenuIframe(message),
initAutofillInlineMenuList: (message) => this.handleInitInlineMenuIframe(message), initAutofillInlineMenuList: (message) => this.handleInitInlineMenuIframe(message),
}; };