Skip to content

Commit

Permalink
Updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
--global committed Dec 19, 2024
1 parent c15d193 commit 30bc31e
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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;

Expand All @@ -121,7 +121,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", () => {
Expand Down

0 comments on commit 30bc31e

Please sign in to comment.