Fix Garmin token connection not persisting after save
All checks were successful
Deploy / deploy (push) Successful in 1m38s
All checks were successful
Deploy / deploy (push) Successful in 1m38s
Root cause: The setup-db script was missing user field definitions (garminConnected, tokens, etc.). Production PocketBase had no such fields, so updates silently failed to persist. Changes: - Add user custom fields to setup-db.ts (matches e2e harness) - Fix status route to use strict boolean check (=== true) - Add verification in tokens route with helpful error message - Add ENCRYPTION_KEY to playwright config for e2e tests - Add comprehensive e2e tests for Garmin connection flow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,10 +12,14 @@ let currentMockUser: User | null = null;
|
||||
// Track PocketBase update calls
|
||||
const mockPbUpdate = vi.fn().mockResolvedValue({});
|
||||
|
||||
// Track PocketBase getOne calls - returns user with garminConnected: true after update
|
||||
const mockPbGetOne = vi.fn().mockResolvedValue({ garminConnected: true });
|
||||
|
||||
// Create mock PocketBase client
|
||||
const mockPb = {
|
||||
collection: vi.fn(() => ({
|
||||
update: mockPbUpdate,
|
||||
getOne: mockPbGetOne,
|
||||
})),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user