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

fix tests

This commit is contained in:
jaasen-livefront
2025-02-18 10:56:53 -08:00
parent 4879bae808
commit 09d3e0b9fe

View File

@@ -51,6 +51,7 @@ describe("AppearanceV2Component", () => {
const enableRoutingAnimation$ = new BehaviorSubject<boolean>(true); const enableRoutingAnimation$ = new BehaviorSubject<boolean>(true);
const enableCompactMode$ = new BehaviorSubject<boolean>(false); const enableCompactMode$ = new BehaviorSubject<boolean>(false);
const showQuickCopyActions$ = new BehaviorSubject<boolean>(false); const showQuickCopyActions$ = new BehaviorSubject<boolean>(false);
const clickItemsToAutofillVaultView$ = new BehaviorSubject<boolean>(false);
const setSelectedTheme = jest.fn().mockResolvedValue(undefined); const setSelectedTheme = jest.fn().mockResolvedValue(undefined);
const setShowFavicons = jest.fn().mockResolvedValue(undefined); const setShowFavicons = jest.fn().mockResolvedValue(undefined);
const setEnableBadgeCounter = jest.fn().mockResolvedValue(undefined); const setEnableBadgeCounter = jest.fn().mockResolvedValue(undefined);
@@ -103,7 +104,10 @@ describe("AppearanceV2Component", () => {
}, },
{ {
provide: VaultSettingsService, provide: VaultSettingsService,
useValue: mock<VaultSettingsService>(), useValue: {
clickItemsToAutofillVaultView$,
setClickItemsToAutofillVaultView: jest.fn().mockResolvedValue(undefined),
},
}, },
], ],
}) })
@@ -122,7 +126,10 @@ describe("AppearanceV2Component", () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
it("populates the form with the user's current settings", () => { it("populates the form with the user's current settings", async () => {
fixture.detectChanges();
await fixture.whenStable();
fixture.detectChanges();
expect(component.appearanceForm.value).toEqual({ expect(component.appearanceForm.value).toEqual({
enableAnimations: true, enableAnimations: true,
enableFavicon: true, enableFavicon: true,
@@ -131,6 +138,7 @@ describe("AppearanceV2Component", () => {
enableCompactMode: false, enableCompactMode: false,
showQuickCopyActions: false, showQuickCopyActions: false,
width: "default", width: "default",
clickItemsToAutofillVaultView: false,
}); });
}); });