Align the project baseline with the latest admin interface styling and layout structure while documenting setup and usage updates in README.
19 lines
569 B
TypeScript
19 lines
569 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { useAuthStore } from "./authStore";
|
|
|
|
describe("authStore", () => {
|
|
it("stores and clears session in memory", () => {
|
|
useAuthStore.getState().setBootstrapped(true);
|
|
useAuthStore.getState().setSession("token", {
|
|
id: "1",
|
|
email: "u@e.com",
|
|
role: "user",
|
|
is_superuser: false,
|
|
status: "active"
|
|
});
|
|
expect(useAuthStore.getState().accessToken).toBe("token");
|
|
useAuthStore.getState().clearSession();
|
|
expect(useAuthStore.getState().accessToken).toBeNull();
|
|
});
|
|
});
|