master
Tudor Stanciu 2023-02-11 03:22:15 +02:00
parent 413594b6ed
commit 238e7010b4
1 changed files with 8 additions and 1 deletions

View File

@ -3,7 +3,7 @@
*/
import axios from "axios";
import { TuitioClient } from "../client";
import { TuitioClient, fetch, invalidate } from "../client";
jest.mock("axios");
@ -22,4 +22,11 @@ test("Tuitio client authentication", async () => {
expect(result.token.validFrom).toStrictEqual(new Date("10/02/2023"));
expect(result.token.validUntil).toStrictEqual(new Date("11/02/2023"));
expect(result.status).toBe("_MOCK_");
const storage = fetch();
expect(storage.userName).toBe("user");
invalidate();
const emptyStorage = fetch();
expect(emptyStorage.userName).toBeNull();
});