mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
add tests
This commit is contained in:
@@ -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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user