-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into PM-15593-Standard-Login-UI-is-shown-when-ite…
…m-has-no-Auth-key-added
- Loading branch information
Showing
226 changed files
with
4,566 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4910,6 +4910,42 @@ | |
"beta": { | ||
"message": "Beta" | ||
}, | ||
"importantNotice": { | ||
"message": "Important notice" | ||
}, | ||
"setupTwoStepLogin": { | ||
"message": "Set up two-step login" | ||
}, | ||
"newDeviceVerificationNoticeContentPage1": { | ||
"message": "Bitwarden will send a code to your account email to verify logins from new devices starting in February 2025." | ||
}, | ||
"newDeviceVerificationNoticeContentPage2": { | ||
"message": "You can set up two-step login as an alternative way to protect your account or change your email to one you can access." | ||
}, | ||
"remindMeLater": { | ||
"message": "Remind me later" | ||
}, | ||
"newDeviceVerificationNoticePageOneFormContent": { | ||
"message": "Do you have reliable access to your email, $EMAIL$?", | ||
"placeholders": { | ||
"email": { | ||
"content": "$1", | ||
"example": "[email protected]" | ||
} | ||
} | ||
}, | ||
"newDeviceVerificationNoticePageOneEmailAccessNo": { | ||
"message": "No, I do not" | ||
}, | ||
"newDeviceVerificationNoticePageOneEmailAccessYes": { | ||
"message": "Yes, I can reliably access my email" | ||
}, | ||
"turnOnTwoStepLogin": { | ||
"message": "Turn on two-step login" | ||
}, | ||
"changeAcctEmail": { | ||
"message": "Change account email" | ||
}, | ||
"extensionWidth": { | ||
"message": "Extension width" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...up/components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<popup-page> | ||
<popup-page [loading]="!cipher"> | ||
<popup-header slot="header" pageTitle="{{ 'passwordHistory' | i18n }}" showBackButton> | ||
<ng-container slot="end"> | ||
<app-pop-out></app-pop-out> | ||
</ng-container> | ||
</popup-header> | ||
<vault-password-history-view *ngIf="cipherId" [cipherId]="cipherId" /> | ||
<vault-password-history-view *ngIf="cipher" [cipher]="cipher" /> | ||
</popup-page> |
42 changes: 31 additions & 11 deletions
42
...components/vault-v2/vault-password-history-v2/vault-password-history-v2.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,76 @@ | ||
import { ComponentFixture, TestBed } from "@angular/core/testing"; | ||
import { ComponentFixture, fakeAsync, TestBed, tick } from "@angular/core/testing"; | ||
import { ActivatedRoute } from "@angular/router"; | ||
import { mock } from "jest-mock-extended"; | ||
import { Subject } from "rxjs"; | ||
import { BehaviorSubject, Subject } from "rxjs"; | ||
|
||
import { WINDOW } from "@bitwarden/angular/services/injection-tokens"; | ||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; | ||
import { Account, AccountService } from "@bitwarden/common/auth/abstractions/account.service"; | ||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; | ||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; | ||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; | ||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; | ||
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; | ||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; | ||
|
||
import { PopupRouterCacheService } from "../../../../../platform/popup/view-cache/popup-router-cache.service"; | ||
|
||
import { PasswordHistoryV2Component } from "./vault-password-history-v2.component"; | ||
|
||
describe("PasswordHistoryV2Component", () => { | ||
let component: PasswordHistoryV2Component; | ||
let fixture: ComponentFixture<PasswordHistoryV2Component>; | ||
const params$ = new Subject(); | ||
|
||
const mockCipherView = { | ||
id: "111-222-333", | ||
name: "cipher one", | ||
} as CipherView; | ||
|
||
const mockCipher = { | ||
decrypt: jest.fn().mockResolvedValue(mockCipherView), | ||
} as unknown as Cipher; | ||
|
||
const back = jest.fn().mockResolvedValue(undefined); | ||
const getCipher = jest.fn().mockResolvedValue(mockCipher); | ||
|
||
beforeEach(async () => { | ||
back.mockClear(); | ||
getCipher.mockClear(); | ||
|
||
await TestBed.configureTestingModule({ | ||
imports: [PasswordHistoryV2Component], | ||
providers: [ | ||
{ provide: WINDOW, useValue: window }, | ||
{ provide: PlatformUtilsService, useValue: mock<PlatformUtilsService>() }, | ||
{ provide: ConfigService, useValue: mock<ConfigService>() }, | ||
{ provide: CipherService, useValue: mock<CipherService>() }, | ||
{ provide: AccountService, useValue: mock<AccountService>() }, | ||
{ provide: CipherService, useValue: mock<CipherService>({ get: getCipher }) }, | ||
{ | ||
provide: AccountService, | ||
useValue: mock<AccountService>({ | ||
activeAccount$: new BehaviorSubject({ id: "acct-1" } as Account), | ||
}), | ||
}, | ||
{ provide: PopupRouterCacheService, useValue: { back } }, | ||
{ provide: ActivatedRoute, useValue: { queryParams: params$ } }, | ||
{ provide: I18nService, useValue: { t: (key: string) => key } }, | ||
], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(PasswordHistoryV2Component); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("sets the cipherId from the params", () => { | ||
params$.next({ cipherId: "444-33-33-1111" }); | ||
it("loads the cipher from params the cipherId from the params", fakeAsync(() => { | ||
params$.next({ cipherId: mockCipherView.id }); | ||
|
||
expect(component["cipherId"]).toBe("444-33-33-1111"); | ||
}); | ||
tick(100); | ||
|
||
expect(getCipher).toHaveBeenCalledWith(mockCipherView.id); | ||
})); | ||
|
||
it("navigates back when a cipherId is not in the params", () => { | ||
params$.next({}); | ||
|
||
expect(back).toHaveBeenCalledTimes(1); | ||
expect(getCipher).not.toHaveBeenCalled(); | ||
}); | ||
}); |
Oops, something went wrong.