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