[PM-9962] Hide remove passkey button when cipher has "except passwords" permissions
This commit is contained in:
parent
9a0188048c
commit
11e874aaef
|
@ -67,7 +67,7 @@
|
|||
bitIconButton="bwi-minus-circle"
|
||||
buttonType="danger"
|
||||
bitSuffix
|
||||
*ngIf="loginDetailsForm.enabled"
|
||||
*ngIf="loginDetailsForm.enabled && viewHiddenFields"
|
||||
[bitAction]="removePasskey"
|
||||
data-testid="remove-passkey-button"
|
||||
[appA11yTitle]="'removePasskey' | i18n"
|
||||
|
|
|
@ -452,6 +452,8 @@ describe("LoginDetailsSectionComponent", () => {
|
|||
|
||||
fixture = TestBed.createComponent(LoginDetailsSectionComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
jest.spyOn(component, "viewHiddenFields", "get").mockReturnValue(true);
|
||||
});
|
||||
|
||||
it("renders the passkey field when available", () => {
|
||||
|
@ -469,7 +471,7 @@ describe("LoginDetailsSectionComponent", () => {
|
|||
it("renders the passkey remove button when editable", () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(getRemovePasskeyBtn).not.toBeNull();
|
||||
expect(getRemovePasskeyBtn()).not.toBeNull();
|
||||
});
|
||||
|
||||
it("does not render the passkey remove button when not editable", () => {
|
||||
|
@ -480,6 +482,14 @@ describe("LoginDetailsSectionComponent", () => {
|
|||
expect(getRemovePasskeyBtn()).toBeNull();
|
||||
});
|
||||
|
||||
it("does not render the passkey remove button when viewHiddenFields is false", () => {
|
||||
jest.spyOn(component, "viewHiddenFields", "get").mockReturnValue(false);
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(getRemovePasskeyBtn()).toBeNull();
|
||||
});
|
||||
|
||||
it("hides the passkey field when missing a passkey", () => {
|
||||
(cipherFormContainer.originalCipherView as CipherView).login.fido2Credentials = [];
|
||||
|
||||
|
|
Loading…
Reference in New Issue