ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/__tests__/api-routes.test.tsx

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/__tests__/api-routes.test.tsx
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/__tests__/api-routes.test.tsx
Original SHA-2566a059fc04d99e5a24c03d5e43c5dcc24e2bd795f008d091ba3c22b35c2877ee8
Git blob SHAfef1bc6651ef6dd61b552aebd34ec639debb6e51
Reading-copy SHA-2566a059fc04d99e5a24c03d5e43c5dcc24e2bd795f008d091ba3c22b35c2877ee8

Original source ↗

Recovered source transcript

/** * Tests for API routes */ import { jest } from '@jest/globals' import * as Auth from '@thedaviddias/auth' // Mock auth jest.mock('@thedaviddias/auth', () => ({ auth: jest.fn() })) const mockAuth = jest.mocked(Auth.auth) // Mock logger jest.mock('@thedaviddias/logging', () => ({ logger: { info: jest.fn(), error: jest.fn(), warn: jest.fn() } })) describe('API Routes', () => { describe('/api/user/export-data', () => { it('should return 401 when user is not authenticated', async () => { mockAuth.mockResolvedValueOnce(null) const { GET } = await import('../app/api/user/export-data/route') const response = await GET() expect(response.status).toBe(401) const data = await response.json() expect(data.error).toBe('Authentication required') }) it('should return user data when authenticated', async () => { mockAuth.mockResolvedValueOnce({ user: { id: 'test-user-id', email: 'test@example.com', user_metadata: { user_name: 'testuser', full_name: null, avatar_url: null } } }) const { GET } = await import('../app/api/user/export-data/route') const response = await GET() expect(response.status).toBe(200) const data = await response.json() // Check structure of exported data expect(data).toHaveProperty('exportDate') expect(data).toHaveProperty('exportVersion') expect(data).toHaveProperty('account') expect(data.account.id).toBe('test-user-id') expect(data.account.email).toBe('test@example.com') expect(data).toHaveProperty('metadata') expect(data).toHaveProperty('platformData') expect(data.platformData.githubConnected).toBe(true) expect(data.platformData.githubUsername).toBe('testuser') }) }) describe('/api/user/delete-account', () => { it('should return 401 when user is not authenticated', async () => { mockAuth.mockResolvedValueOnce(null) const { DELETE } = await import('../app/api/user/delete-account/route') const response = await DELETE() expect(response.status).toBe(401) const data = await response.json() expect(data.error).toBe('Unauthorized') }) }) })

Search equations, builds, manuscript text, and recovered sources.