1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 04:33:38 +00:00

when only password and new password fields have values and do not match any vault ciphers, trigger a new cipher notification (#18729)

This commit is contained in:
Jonathan Prusik
2026-02-03 11:05:02 -05:00
committed by GitHub
parent 8fb84a4670
commit fe0d7df538
2 changed files with 11 additions and 2 deletions

View File

@@ -1727,7 +1727,7 @@ describe("NotificationBackground", () => {
expect(pushAddLoginToQueueSpy).not.toHaveBeenCalled();
});
it("and no cipher update candidates match `password` or `newPassword`, do not trigger a notification", async () => {
it("and no cipher update candidates match `password` or `newPassword`, trigger a new cipher notification", async () => {
const storedCiphersForURL = [
mock<CipherView>({
id: "cipher-id-1",
@@ -1745,7 +1745,15 @@ describe("NotificationBackground", () => {
await notificationBackground.triggerCipherNotification(formEntryData, tab);
expect(pushChangePasswordToQueueSpy).not.toHaveBeenCalled();
expect(pushAddLoginToQueueSpy).not.toHaveBeenCalled();
expect(pushAddLoginToQueueSpy).toHaveBeenCalledWith(
mockFormattedURI,
{
password: formEntryData.newPassword,
url: formEntryData.uri,
username: formEntryData.username,
},
sender.tab,
);
});
});

View File

@@ -992,6 +992,7 @@ export default class NotificationBackground {
inputScenarios.usernameNewPassword,
inputScenarios.usernamePassword,
inputScenarios.username,
inputScenarios.passwordNewPassword,
] as InputScenario[]
).includes(inputScenario) &&
newLoginNotificationIsEnabled