-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
5 Jest test files (36 tests) are testing integration-level concerns with fragile mocks. They should be migrated to the browser integration test system (src/background/core-business-tests.js) where they can run against real IndexedDB and Chrome APIs.
These tests have been marked with describe.skip and comments explaining the migration rationale.
Files to Migrate
High Priority
| File | Tests | Reason |
|---|---|---|
src/shared/db/__tests__/problems.boxlevel.test.js |
8 | Manually simulates IndexedDB cursor iteration with fragile mocks |
src/shared/services/__tests__/background.critical.test.js |
4 | Tests Chrome API availability via mocked globals (circular logic) |
src/shared/services/__tests__/errorRecovery.infrastructure.test.js |
14 | Simulates deadlocks/memory pressure on fully mocked services |
src/shared/db/stores/__tests__/findPrerequisiteProblem.test.js |
7 | Uses fake-indexeddb with custom schema that may diverge from production |
Medium Priority (Duplicate)
| File | Tests | Reason |
|---|---|---|
src/shared/db/stores/__tests__/sessions.test.js |
3 | Exact duplicate of browser test #20 (testSessionDateSorting) |
Additional Jest tests to consider (not yet skipped)
These are lower priority but also test integration concerns with heavy mocking:
storageService.critical.test.js— Chrome storage context detectionsessionService.enhanced.test.js— Race condition tests against mocked serviceschromeMessaging.infrastructure.test.js— Mocked Chrome messagingleitnerSystem.test.js(DB cursor portions only) —reassessBoxLevelcursor simulationbackgroundScript.integration.test.js— Misnamed; tests handler routing with mockssessionAttribution.integration.test.js— Tests inline pure functions, not real attribution
Migration Approach
- Add equivalent test functions to
core-business-tests.jsusing the existingsmartTestIsolation()andCodeMaster_testdatabase infrastructure - Register new tests on
globalThisfollowing the existing pattern - Verify browser tests pass in dev mode
- Delete the skipped Jest files
Labels
test, tech-debt
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels