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 63941c6a467..fab3c8f1ab1 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 @@

{{ "customFields" | i18n }}

bitSuffix bitPasswordInputToggle data-testid="visibility-for-custom-hidden-field" - [disabled]="!canViewPasswords(i)" + *ngIf="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 a5e57d2858f..b523d9ef933 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("forbids a user to view hidden fields when the cipher `viewPassword` is false", () => { + it("when `viewPassword` is false the user cannot see the view toggle option", () => { originalCipherView.viewPassword = false; originalCipherView.fields = mockFieldViews; @@ -123,7 +123,20 @@ describe("CustomFieldsComponent", () => { const button = fixture.debugElement.query(By.directive(BitPasswordInputToggleDirective)); - expect(button.nativeElement.disabled).toBe(true); + 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(); }); 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 45ddc3c1dea..591ed2e53d8 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,6 +36,7 @@

{{ "customFields" | i18n }}