[PM-8519] Inline Menu fails to Update Credentials After Saving New Cipher When Unlocking Extension
This commit is contained in:
parent
c9c6b7a21f
commit
15b9a237b8
|
@ -76,7 +76,9 @@ type OverlayBackgroundExtensionMessageHandlers = {
|
|||
updateFocusedFieldData: ({ message }: BackgroundMessageParam) => void;
|
||||
collectPageDetailsResponse: ({ message, sender }: BackgroundOnMessageHandlerParams) => void;
|
||||
unlockCompleted: ({ message }: BackgroundMessageParam) => void;
|
||||
addedCipher: () => void;
|
||||
addEditCipherSubmitted: () => void;
|
||||
editedCipher: () => void;
|
||||
deletedCipher: () => void;
|
||||
};
|
||||
|
||||
|
|
|
@ -961,29 +961,23 @@ describe("OverlayBackground", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("addEditCipherSubmitted message handler", () => {
|
||||
it("updates the overlay ciphers", () => {
|
||||
const message = {
|
||||
command: "addEditCipherSubmitted",
|
||||
};
|
||||
jest.spyOn(overlayBackground as any, "updateOverlayCiphers").mockImplementation();
|
||||
describe("extension messages that trigger an update of the inline menu ciphers", () => {
|
||||
const extensionMessages = [
|
||||
"addedCipher",
|
||||
"addEditCipherSubmitted",
|
||||
"editedCipher",
|
||||
"deletedCipher",
|
||||
];
|
||||
|
||||
sendExtensionRuntimeMessage(message);
|
||||
|
||||
expect(overlayBackground["updateOverlayCiphers"]).toHaveBeenCalled();
|
||||
beforeEach(() => {
|
||||
jest.spyOn(overlayBackground, "updateOverlayCiphers").mockImplementation();
|
||||
});
|
||||
});
|
||||
|
||||
describe("deletedCipher message handler", () => {
|
||||
it("updates the overlay ciphers", () => {
|
||||
const message = {
|
||||
command: "deletedCipher",
|
||||
};
|
||||
jest.spyOn(overlayBackground as any, "updateOverlayCiphers").mockImplementation();
|
||||
|
||||
sendExtensionRuntimeMessage(message);
|
||||
|
||||
expect(overlayBackground["updateOverlayCiphers"]).toHaveBeenCalled();
|
||||
extensionMessages.forEach((message) => {
|
||||
it(`triggers an update of the overlay ciphers when the ${message} message is received`, () => {
|
||||
sendExtensionRuntimeMessage({ command: message });
|
||||
expect(overlayBackground.updateOverlayCiphers).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -69,7 +69,9 @@ class OverlayBackground implements OverlayBackgroundInterface {
|
|||
updateFocusedFieldData: ({ message }) => this.setFocusedFieldData(message),
|
||||
collectPageDetailsResponse: ({ message, sender }) => this.storePageDetails(message, sender),
|
||||
unlockCompleted: ({ message }) => this.unlockCompleted(message),
|
||||
addedCipher: () => this.updateOverlayCiphers(),
|
||||
addEditCipherSubmitted: () => this.updateOverlayCiphers(),
|
||||
editedCipher: () => this.updateOverlayCiphers(),
|
||||
deletedCipher: () => this.updateOverlayCiphers(),
|
||||
};
|
||||
private readonly overlayButtonPortMessageHandlers: OverlayButtonPortMessageHandlers = {
|
||||
|
|
Loading…
Reference in New Issue