tuitio token fix

master
Tudor Stanciu 2023-02-11 05:31:25 +02:00
parent 495c5c79c9
commit e972a5ea01
2 changed files with 3 additions and 1 deletions

View File

@ -24,10 +24,12 @@ test("Tuitio client authentication", async () => {
expect(result.status).toBe("_MOCK_");
const storage = fetch();
expect(storage.token.raw).toBe("mock-user-pass");
expect(storage.userName).toBe("user");
invalidate();
const emptyStorage = fetch();
expect(emptyStorage.token).toBeNull();
expect(emptyStorage.userName).toBeNull();
});

View File

@ -53,7 +53,7 @@ const invalidate = (): void => {
}
};
export type TuitioState = { token: string; userName: string };
export type TuitioState = { token: TuitioToken; userName: string };
const fetch = (): TuitioState => {
const data = {