Fix `npm run test:types`
This commit is contained in:
parent
855995a7ea
commit
32b34d6014
|
@ -65,6 +65,7 @@ describe("UserDecryptionOptionsService", () => {
|
|||
await fakeAccountService.addAccount(givenUser, {
|
||||
name: "Test User 1",
|
||||
email: "test1@email.com",
|
||||
emailVerified: false,
|
||||
});
|
||||
await fakeStateProvider.setUserState(
|
||||
USER_DECRYPTION_OPTIONS,
|
||||
|
|
|
@ -56,6 +56,7 @@ describe("AuthService", () => {
|
|||
status: AuthenticationStatus.Unlocked,
|
||||
id: userId,
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
name: "name",
|
||||
};
|
||||
|
||||
|
@ -109,6 +110,7 @@ describe("AuthService", () => {
|
|||
status: AuthenticationStatus.Unlocked,
|
||||
id: Utils.newGuid() as UserId,
|
||||
email: "email2",
|
||||
emailVerified: false,
|
||||
name: "name2",
|
||||
};
|
||||
|
||||
|
@ -126,7 +128,11 @@ describe("AuthService", () => {
|
|||
it("requests auth status for all known users", async () => {
|
||||
const userId2 = Utils.newGuid() as UserId;
|
||||
|
||||
await accountService.addAccount(userId2, { email: "email2", name: "name2" });
|
||||
await accountService.addAccount(userId2, {
|
||||
email: "email2",
|
||||
emailVerified: false,
|
||||
name: "name2",
|
||||
});
|
||||
|
||||
const mockFn = jest.fn().mockReturnValue(of(AuthenticationStatus.Locked));
|
||||
sut.authStatusFor$ = mockFn;
|
||||
|
|
|
@ -31,10 +31,12 @@ describe("EnvironmentService", () => {
|
|||
[testUser]: {
|
||||
name: "name",
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
},
|
||||
[alternateTestUser]: {
|
||||
name: "name",
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
},
|
||||
});
|
||||
stateProvider = new FakeStateProvider(accountService);
|
||||
|
@ -47,6 +49,7 @@ describe("EnvironmentService", () => {
|
|||
id: userId,
|
||||
email: "test@example.com",
|
||||
name: `Test Name ${userId}`,
|
||||
emailVerified: false,
|
||||
});
|
||||
await awaitAsync();
|
||||
};
|
||||
|
|
|
@ -33,6 +33,7 @@ describe("UserKeyInitService", () => {
|
|||
id: mockUserId,
|
||||
name: "name",
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
});
|
||||
|
||||
(userKeyInitService as any).setUserKeyInMemoryIfAutoUserKeySet = jest.fn();
|
||||
|
@ -56,6 +57,7 @@ describe("UserKeyInitService", () => {
|
|||
id: mockUserId,
|
||||
name: "name",
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
});
|
||||
|
||||
const mockUser2Id = Utils.newGuid() as UserId;
|
||||
|
@ -72,6 +74,7 @@ describe("UserKeyInitService", () => {
|
|||
id: mockUser2Id,
|
||||
name: "name",
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
});
|
||||
|
||||
// Assert
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { mock } from "jest-mock-extended";
|
||||
|
||||
import { mockAccountServiceWith, trackEmissions } from "../../../../spec";
|
||||
import { AuthenticationStatus } from "../../../auth/enums/authentication-status";
|
||||
import { UserId } from "../../../types/guid";
|
||||
import { SingleUserStateProvider } from "../user-state.provider";
|
||||
|
||||
|
@ -14,7 +13,7 @@ describe("DefaultActiveUserStateProvider", () => {
|
|||
id: userId,
|
||||
name: "name",
|
||||
email: "email",
|
||||
status: AuthenticationStatus.Locked,
|
||||
emailVerified: false,
|
||||
};
|
||||
const accountService = mockAccountServiceWith(userId, accountInfo);
|
||||
let sut: DefaultActiveUserStateProvider;
|
||||
|
|
|
@ -82,6 +82,7 @@ describe("DefaultActiveUserState", () => {
|
|||
activeAccountSubject.next({
|
||||
id: userId,
|
||||
email: `test${id}@example.com`,
|
||||
emailVerified: false,
|
||||
name: `Test User ${id}`,
|
||||
});
|
||||
await awaitAsync();
|
||||
|
|
|
@ -69,7 +69,12 @@ describe("DefaultStateProvider", () => {
|
|||
userId?: UserId,
|
||||
) => Observable<string>,
|
||||
) => {
|
||||
const accountInfo = { email: "email", name: "name", status: AuthenticationStatus.LoggedOut };
|
||||
const accountInfo = {
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
name: "name",
|
||||
status: AuthenticationStatus.LoggedOut,
|
||||
};
|
||||
const keyDefinition = new KeyDefinition<string>(new StateDefinition("test", "disk"), "test", {
|
||||
deserializer: (s) => s,
|
||||
});
|
||||
|
@ -114,7 +119,12 @@ describe("DefaultStateProvider", () => {
|
|||
);
|
||||
|
||||
describe("getUserState$", () => {
|
||||
const accountInfo = { email: "email", name: "name", status: AuthenticationStatus.LoggedOut };
|
||||
const accountInfo = {
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
name: "name",
|
||||
status: AuthenticationStatus.LoggedOut,
|
||||
};
|
||||
const keyDefinition = new KeyDefinition<string>(new StateDefinition("test", "disk"), "test", {
|
||||
deserializer: (s) => s,
|
||||
});
|
||||
|
|
|
@ -62,6 +62,7 @@ describe("SendService", () => {
|
|||
accountService.activeAccountSubject.next({
|
||||
id: mockUserId,
|
||||
email: "email",
|
||||
emailVerified: false,
|
||||
name: "name",
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue