first commit

This commit is contained in:
domrichardson
2026-03-24 16:03:04 +00:00
commit df40cc57e1
80 changed files with 16766 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import { describe, it, expect, beforeEach, vi } from "vitest";
import { useAuthStore } from "../../src/stores/authStore";
import { createPinia, setActivePinia } from "pinia";
describe("Auth Store", () => {
beforeEach(() => {
setActivePinia(createPinia());
});
it("should initialize with no user", () => {
const store = useAuthStore();
expect(store.isAuthenticated).toBe(false);
expect(store.user).toBeNull();
});
it("should store user data on login", () => {
const store = useAuthStore();
// Mock user data
const mockUser = {
id: "123",
email: "test@example.com",
username: "testuser",
};
// In a real test, you'd mock the API call
// For now, just test the store structure
expect(store.user).toBeNull();
});
it("should clear user data on logout", () => {
const store = useAuthStore();
store.logout();
expect(store.isAuthenticated).toBe(false);
expect(store.user).toBeNull();
expect(store.accessToken).toBeNull();
});
});