tuitio token fix
parent
495c5c79c9
commit
e972a5ea01
|
@ -24,10 +24,12 @@ test("Tuitio client authentication", async () => {
|
||||||
expect(result.status).toBe("_MOCK_");
|
expect(result.status).toBe("_MOCK_");
|
||||||
|
|
||||||
const storage = fetch();
|
const storage = fetch();
|
||||||
|
expect(storage.token.raw).toBe("mock-user-pass");
|
||||||
expect(storage.userName).toBe("user");
|
expect(storage.userName).toBe("user");
|
||||||
|
|
||||||
invalidate();
|
invalidate();
|
||||||
const emptyStorage = fetch();
|
const emptyStorage = fetch();
|
||||||
|
expect(emptyStorage.token).toBeNull();
|
||||||
expect(emptyStorage.userName).toBeNull();
|
expect(emptyStorage.userName).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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 fetch = (): TuitioState => {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
Loading…
Reference in New Issue