Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

docs(testing): list the tests for channel verification and upload settings

spacesdriveb46d974d0ee8
diff --git a/docs/workflows/TESTING.md b/docs/workflows/TESTING.md
index 855603b..2d9304a 100644
--- a/docs/workflows/TESTING.md
+++ b/docs/workflows/TESTING.md
@@ -100,7 +100,7 @@ Comment automation has its own tests. `tests/lib/automationMatching.test.ts` cov
The MCP server has its own tests. `tests/lib/mcp/protocol.test.ts` covers parsing JSON-RPC, the two protocol eras, the header checks and the error replies; `tests/lib/mcp/accessToken.test.ts` and `confirmation.test.ts` the token format and hash, and that a confirmation fails for other arguments, another tool, another person or after five minutes. `tests/services/mcpAccessService.test.ts` covers creating, listing, revoking and authenticating tokens and approving clients; `tests/services/mcpService.test.ts` the dispatch, that read-only callers never see or run write tools, the confirmation flow, the timeout, the result size cap and the audit lines. `tests/mcp/scheduledPostTools.test.ts`, `tests/mcp/analyticsTools.test.ts` and `tests/mcp/mediaTools.test.ts` check each tool's input checks, paging and that another person's records are not found and tokens never appear; `tests/routes/mcpRoutes.test.ts` runs `/mcp` and `/api/mcp/*` in the full app (401 with the challenge, the Origin check, 405 for GET, revoked tokens). The media tools also have `tests/services/mediaService.test.ts` (records per person, no Cloudinary id in results, deletes with and without the API secret), `tests/validators/mediaValidators.test.ts` (only public https addresses) and `tests/services/cloudinary/cloudinaryApi.test.ts` (the request Cloudinary gets, and the signature checked against Cloudinary's documented example). On the frontend, `tests/features/settings/claudeAccessData.test.ts` covers the Settings section's helpers, `tests/lib/oauthConsent.test.ts` which return addresses the consent page accepts, and `tests/lib/signInPage.test.ts` that signing in returns only to a path on this site.
-YouTube publishing has its own tests: `tests/lib/youtubeUpload.test.ts` (chunk math, the Range header, Shorts, metadata limits, backoff, failure classes, the Pacific midnight), `tests/lib/tokenCrypto.test.ts` (sealing, wrong key, tampering), `tests/services/youtubeUploadRunner.test.ts` (every runner transition, the budget and a lost lease), `tests/services/youtubeConnectService.test.ts` (the sign-in bound to its starter, sealed tokens, reconnect, a refused refresh), `tests/services/youtubeUploadService.test.ts`, `tests/routes/youtubeRoutes.test.ts` (the callback) and `tests/mcp/youtubeTools.test.ts`; on the frontend `tests/features/youtube/youtubeUploadData.test.ts`.
+YouTube publishing has its own tests: `tests/lib/youtubeUpload.test.ts` (chunk math, the Range header, Shorts, metadata limits, backoff, failure classes, the Pacific midnight), `tests/lib/tokenCrypto.test.ts` (sealing, wrong key, tampering), `tests/services/youtubeUploadRunner.test.ts` (every runner transition, the budget and a lost lease), `tests/services/youtubeConnectService.test.ts` (the sign-in bound to its starter and to one of their YouTube accounts, a different channel refused and its access revoked, sealed tokens, reconnect, a refused refresh, publishing turned off with its account), `tests/services/youtubeUploadService.test.ts`, `tests/routes/youtubeRoutes.test.ts` (the callback, and a verify link only for the caller's own YouTube account) and `tests/mcp/youtubeTools.test.ts`; on the frontend `tests/features/youtube/youtubeUploadData.test.ts` and `tests/features/accounts/youtubePublishingState.test.ts` (each YouTube card's publishing state and the Google return errors). `tests/lib/cloudinaryConfigState.test.ts` covers the upload settings' loading, ready and failed states.
The Send Email hook has its own tests: `tests/lib/webhookSignature.test.ts` (valid, tampered, wrong-key, multi-signature and replayed requests), `tests/validators/authHookValidators.test.ts`, `tests/services/email/authEmails.test.ts` (the email for each action, the verify links, HTML escaping and the two Secure Email Change emails), `tests/repositories/emailQuotaRepository.test.ts` (daily and per-address caps, hashed keys, Redis failures), `tests/services/authEmailService.test.ts` (Resend requests, idempotency keys, the caps and Resend's own quota errors, skipped notices) and `tests/routes/authHookRoutes.test.ts` (the hook error shape, and the route answering unsigned calls with 401 in the full app). `tests/fixtures/authHook.ts` signs requests the way Supabase Auth does. The Lua claim script cannot run in Node; the repository test runs the same rules in memory. On the frontend, `tests/lib/authErrors.test.ts` covers when the sign-in page shows the daily cap warning and whether it offers Google, `tests/lib/emailAddress.test.ts` when an address looks complete enough to enable the Continue arrow, `tests/lib/googleIdentity.test.ts` the label drawn on the Google button for each text option, and `tests/lib/signInPage.test.ts` when the sign-in page opens the dashboard for a stored session and when it leaves a sign-in on the page to finish.