mirror of
https://dev.azure.com/tstanciu94/Packages/_git/tuitio-client
synced 2025-03-30 04:21:40 +03:00
tests
This commit is contained in:
parent
413594b6ed
commit
238e7010b4
@ -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();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user