mirror of
https://github.com/coleam00/Archon.git
synced 2026-01-03 21:37:46 -05:00
Add Supabase key validation and simplify frontend state management
- Add backend validation to detect and warn about anon vs service keys - Prevent startup with incorrect Supabase key configuration - Consolidate frontend state management following KISS principles - Remove duplicate state tracking and sessionStorage polling - Add clear error display when backend fails to start - Improve .env.example documentation with detailed key selection guide - Add comprehensive test coverage for validation logic - Remove unused test results checking to eliminate 404 errors The implementation now warns users about key misconfiguration while maintaining backward compatibility. Frontend state is simplified with MainLayout as the single source of truth for backend status.
This commit is contained in:
@@ -2,6 +2,9 @@ import { expect, afterEach, vi } from 'vitest'
|
||||
import { cleanup } from '@testing-library/react'
|
||||
import '@testing-library/jest-dom/vitest'
|
||||
|
||||
// Set required environment variables for tests
|
||||
process.env.ARCHON_SERVER_PORT = '8181'
|
||||
|
||||
// Clean up after each test
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
@@ -15,7 +18,7 @@ global.fetch = vi.fn(() =>
|
||||
text: () => Promise.resolve(''),
|
||||
status: 200,
|
||||
} as Response)
|
||||
)
|
||||
) as any
|
||||
|
||||
// Mock WebSocket
|
||||
class MockWebSocket {
|
||||
|
||||
Reference in New Issue
Block a user