diff --git a/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.html b/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.html index fab3c8f1ab1..63941c6a467 100644 --- a/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.html +++ b/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.html @@ -46,7 +46,7 @@ bitSuffix bitPasswordInputToggle data-testid="visibility-for-custom-hidden-field" - *ngIf="canViewPasswords(i)" + [disabled]="!canViewPasswords(i)" (toggledChange)="logHiddenEvent($event)" > diff --git a/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.spec.ts b/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.spec.ts index b523d9ef933..a5e57d2858f 100644 --- a/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.spec.ts +++ b/libs/vault/src/cipher-form/components/custom-fields/custom-fields.component.spec.ts @@ -113,7 +113,7 @@ describe("CustomFieldsComponent", () => { ]); }); - it("when `viewPassword` is false the user cannot see the view toggle option", () => { + it("forbids a user to view hidden fields when the cipher `viewPassword` is false", () => { originalCipherView.viewPassword = false; originalCipherView.fields = mockFieldViews; @@ -123,20 +123,7 @@ describe("CustomFieldsComponent", () => { const button = fixture.debugElement.query(By.directive(BitPasswordInputToggleDirective)); - expect(button).toBeFalsy(); - }); - - it("when `viewPassword` is true the user can see the view toggle option", () => { - originalCipherView.viewPassword = true; - originalCipherView.fields = mockFieldViews; - - component.ngOnInit(); - - fixture.detectChanges(); - - const button = fixture.debugElement.query(By.directive(BitPasswordInputToggleDirective)); - - expect(button).toBeTruthy(); + expect(button.nativeElement.disabled).toBe(true); }); describe("linkedFieldOptions", () => { diff --git a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html index 8eee79729af..ab31ede57bb 100644 --- a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html +++ b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html @@ -36,7 +36,6 @@