mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 08:52:25 +00:00
Document areas that still need test coverage improvement, prioritized by impact and risk. https://claude.ai/code/session_01WbLkUVQ5yi1bnSvGZErC3C
4.4 KiB
4.4 KiB
TODO: Improve Test Coverage for Untested Areas
Source: Test coverage analysis (Feb 2026)
Context: Several areas of the codebase lack unit test coverage. This document tracks the remaining gaps after the initial test coverage expansion.
High Priority
Storage Layer
Files with no tests that handle critical upload/storage functionality:
js/storage/s3-multipart.js- Multipart upload logic, bucket managementjs/storage/s3-client.js- S3 client wrapper, SDK loadingjs/storage/r2-mgmt.js- R2 bucket management operationsjs/storage/r2-s3.js- R2/S3 integration layerjs/services/s3UploadService.js- Upload orchestration and progress tracking
Why: These are user-facing upload paths. Failures here directly impact content creators.
Medium Priority
DM Components
The js/ui/dm/ directory lacks unit tests:
ConversationList.js- Conversation list renderingMessageThread.js- Message thread displayMessageBubble.js- Individual message renderingComposer.js- Message composition UIZapInterface.js- Zap sending interfaceNotificationCenter.js- DM notification handlingAvatar.js- Profile avatar displayContactRow.js- Contact list itemDMPrivacySettings.js- Privacy settings UIAppShell.js- DM app shell layout
Why: Growing feature area with complex state management.
Video Utilities
js/utils/videoTimestamps.js- Timestamp parsing and formattingjs/utils/videoPointer.js- Video pointer utilitiesjs/utils/torrentHash.js- Torrent hash utilities
Why: Core video functionality used throughout the app.
Low-Medium Priority
Kids Mode Features
Safety-critical filtering that should have thorough test coverage:
js/feedEngine/kidsAudienceFilterStage.js- Kids mode content filteringjs/feedEngine/kidsScoring.js- Kids-appropriate content scoring
Why: Safety-critical filtering for younger audiences.
Application Bootstrap
js/app.js- Main application orchestratorjs/bootstrap.js- Application initializationjs/applicationContext.js- Application context management
Why: Complex initialization logic that's difficult to test but important for reliability.
Low Priority
Miscellaneous Utilities
js/utils/domUtils.js- DOM helper functionsjs/utils/hex.js- Hex encoding utilitiesjs/utils/qrcode.js- QR code generationjs/utils/linkPreviewSettings.js- Link preview configurationjs/utils/storage.js- Local storage utilitiesjs/utils/storagePointer.js- Storage pointer helpersjs/utils/profileMedia.js- Profile media handling
UI Components
js/ui/ModalManager.js- Modal lifecycle managementjs/ui/initEditModal.js- Edit modal initializationjs/ui/initDeleteModal.js- Delete modal initializationjs/ui/watchHistoryController.js- Watch history UIjs/ui/profileIdentityController.js- Profile identity displayjs/ui/ambientBackground.js- Ambient background effectsjs/ui/components/DeleteModal.js- Delete confirmation modaljs/ui/components/FeedInfoPopover.js- Feed information popoverjs/ui/components/EventDetailsModal.js- Event details displayjs/ui/components/EmbedVideoModal.js- Video embed modal
Nostr Internals
js/nostr/dmDecryptWorker.js- DM decryption web workerjs/nostr/dmDecryptWorkerClient.js- Worker client interfacejs/nostr/nip04Worker.js- NIP-04 web workerjs/nostr/nip04WorkerClient.js- NIP-04 worker clientjs/nostr/countDiagnostics.js- Count query diagnosticsjs/nostr/maxListenerDiagnostics.js- Event listener diagnostics
E2E Test Gaps
Only 6 E2E tests exist. Consider adding:
- Full upload flow (video file -> published note)
- Video playback fallback scenarios (URL -> magnet)
- Authentication flows (NIP-07, NIP-46 connection)
- Relay switching behavior under failure conditions
- Watch history persistence and sync
- DM conversation flow
Notes
- When adding tests, follow existing patterns in
tests/directory - Use
node:testandnode:assert/strictfor unit tests - Use Playwright for E2E tests
- Mock external dependencies (nostr-tools, relays) appropriately
- Run
npm run test:unitto verify new tests pass