-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Milestone
Description
Summary
The JavaScript codebase lacks unit test coverage for critical state management code. Adding tests will prevent regressions and enable confident refactoring.
Scope
Priority 1: Redux Reducers (src/react/reducers/)
apiReducer- Entry CRUD operations, polling state, error handlinguserReducer- Author selection, config loading- Test state shape, immutability, edge cases
Priority 2: Redux-Observable Epics (src/react/epics/)
getEntriesEpic- Pagination, error handlingpollingEpic- Start/stop, interval handlingcrudEpic- Create/update/delete operations- Use RxJS marble testing for async flows
Priority 3: React Components
AuthorSelectOption- Keyboard navigation, focus statesEntryContainer- Edit mode, delete confirmation- Use React Testing Library
Technical Approach
# Dependencies already available
npm test -- --coverage// Example reducer test
describe('apiReducer', () => {
it('handles GET_ENTRIES_SUCCESS', () => {
const action = { type: 'GET_ENTRIES_SUCCESS', payload: [entry1] };
const state = apiReducer(initialState, action);
expect(state.entries).toHaveLength(1);
expect(state.loading).toBe(false);
});
});Acceptance Criteria
- 80%+ coverage for reducers
- All epics tested with marble diagrams
- Critical user flows covered
- Tests run in CI pipeline
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels