1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

add tests

This commit is contained in:
jaasen-livefront
2025-02-18 11:00:34 -08:00
parent 09d3e0b9fe
commit 80bf2db0d9

View File

@@ -58,6 +58,7 @@ describe("AppearanceV2Component", () => {
const setEnableRoutingAnimation = jest.fn().mockResolvedValue(undefined); const setEnableRoutingAnimation = jest.fn().mockResolvedValue(undefined);
const setEnableCompactMode = jest.fn().mockResolvedValue(undefined); const setEnableCompactMode = jest.fn().mockResolvedValue(undefined);
const setShowQuickCopyActions = jest.fn().mockResolvedValue(undefined); const setShowQuickCopyActions = jest.fn().mockResolvedValue(undefined);
const setClickItemsToAutofillVaultView = jest.fn().mockResolvedValue(undefined);
const mockWidthService: Partial<PopupSizeService> = { const mockWidthService: Partial<PopupSizeService> = {
width$: new BehaviorSubject("default"), width$: new BehaviorSubject("default"),
@@ -106,7 +107,7 @@ describe("AppearanceV2Component", () => {
provide: VaultSettingsService, provide: VaultSettingsService,
useValue: { useValue: {
clickItemsToAutofillVaultView$, clickItemsToAutofillVaultView$,
setClickItemsToAutofillVaultView: jest.fn().mockResolvedValue(undefined), setClickItemsToAutofillVaultView,
}, },
}, },
], ],
@@ -166,5 +167,29 @@ describe("AppearanceV2Component", () => {
expect(setEnableRoutingAnimation).toHaveBeenCalledWith(false); expect(setEnableRoutingAnimation).toHaveBeenCalledWith(false);
}); });
it("updates the compact mode setting", () => {
component.appearanceForm.controls.enableCompactMode.setValue(true);
expect(setEnableCompactMode).toHaveBeenCalledWith(true);
});
it("updates the quick copy actions setting", () => {
component.appearanceForm.controls.showQuickCopyActions.setValue(true);
expect(setShowQuickCopyActions).toHaveBeenCalledWith(true);
});
it("updates the width setting", () => {
component.appearanceForm.controls.width.setValue("wide");
expect(mockWidthService.setWidth).toHaveBeenCalledWith("wide");
});
it("updates the click items to autofill vault view setting", () => {
component.appearanceForm.controls.clickItemsToAutofillVaultView.setValue(true);
expect(setClickItemsToAutofillVaultView).toHaveBeenCalledWith(true);
});
}); });
}); });