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:
@@ -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,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -992,6 +992,7 @@ export default class NotificationBackground {
|
||||
inputScenarios.usernameNewPassword,
|
||||
inputScenarios.usernamePassword,
|
||||
inputScenarios.username,
|
||||
inputScenarios.passwordNewPassword,
|
||||
] as InputScenario[]
|
||||
).includes(inputScenario) &&
|
||||
newLoginNotificationIsEnabled
|
||||
|
||||
Reference in New Issue
Block a user