1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 22:13:32 +00:00

Fixes refresh test, source argument missing.

This commit is contained in:
Miles Blackwood
2025-06-20 11:56:40 -04:00
parent 7c6bf03f57
commit e35e1855f6
2 changed files with 6 additions and 4 deletions

View File

@@ -3604,12 +3604,14 @@ describe("OverlayBackground", () => {
});
it("sends a message to the list port indicating that the generated password should be updated", async () => {
overlayBackground["generatedPassword"] = "refresh";
sendPortMessage(listMessageConnectorSpy, { command: "refreshGeneratedPassword", portKey });
await flushPromises();
expect(listPortSpy.postMessage).toHaveBeenCalledWith({
command: "updateAutofillInlineMenuGeneratedPassword",
generatedPassword,
generatedPassword: "refresh",
refreshPassword: true,
});
});

View File

@@ -1813,7 +1813,7 @@ export class OverlayBackground implements OverlayBackgroundInterface {
/**
* Generates a password based on the user defined password generation options.
*/
private async requestGeneratedPassword(source: GenerateRequest["source"]) {
private requestGeneratedPassword(source: GenerateRequest["source"]) {
this.requestGeneratedPassword$.next({ source, type: Type.password });
}
@@ -1824,7 +1824,7 @@ export class OverlayBackground implements OverlayBackgroundInterface {
*/
private async updateGeneratedPassword(refreshPassword: boolean = false) {
if (!this.generatedPassword || refreshPassword) {
await this.requestGeneratedPassword("inline-menu");
this.requestGeneratedPassword("inline-menu");
}
this.postMessageToPort(this.inlineMenuListPort, {
@@ -3089,7 +3089,7 @@ export class OverlayBackground implements OverlayBackgroundInterface {
}
if (!this.generatedPassword) {
await this.requestGeneratedPassword();
this.requestGeneratedPassword("inline-menu");
}
return true;