- Email:
dingotrack-test@gmail.com(or similar) - Use this ONLY for automated testing
Run this script to authenticate and get refresh token:
node scripts/get-test-refresh-token.jsThis will:
- Open browser for OAuth
- Print refresh token to console
- Save to
.env.testfile
Add these secrets to your GitHub repository:
TEST_GOOGLE_REFRESH_TOKEN- From step 2GOOGLE_CLIENT_ID- Your OAuth client ID (already exists)GOOGLE_CLIENT_SECRET- Your OAuth client secret (already exists)
# Load test credentials
export $(cat .env.test | xargs)
# Run calendar tests
pnpm test:calendarexport TEST_GOOGLE_REFRESH_TOKEN="your_refresh_token_here"
export GOOGLE_CLIENT_ID="your_client_id"
export GOOGLE_CLIENT_SECRET="your_client_secret"
pnpm test:calendarpnpm test:calendar:watch✅ OAuth Token Management
- Refresh token → access token exchange
- Auto token refresh on expiry
- Invalid token handling
✅ Calendar API
- Fetch calendar list
- Create events
- Minute boundary alignment
- Error handling
✅ Full Timer Flow
- Start/stop timer
- Automatic calendar event creation
- Short timer handling (< 1 minute)
- Event alignment verification
Tests run automatically on:
- Every push to
main - All pull requests
- Manual workflow dispatch
See .github/workflows/test-calendar.yml
Tests create events with names like:
Test Event 1729368000000Integration Test 1729368000000Short Timer 1729368000000
These can be manually deleted from the test calendar periodically, or add cleanup logic in the test file.
- Missing
TEST_GOOGLE_REFRESH_TOKENenvironment variable - Run setup steps above
- Refresh token expired (rare but possible)
- Re-run
scripts/get-test-refresh-token.js
- Test account doesn't have calendar access
- Check account permissions
- Check you're looking at the correct calendar (primary)
- Events may take a few seconds to appear
- Verify calendar ID in test output