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();
  });
});
