Skip to content

discussion: adding unit/integration tests for client . files #4068

@kunstewi

Description

@kunstewi

Proposed Tests

File Type What to Cover
i18n.js Unit languageKeyToLabel, languageKeyToDateLocale, currentDateLocale, language selection precedence (window.INITIAL_STATE vs detected fallback)
persistState.ts Unit Save/load/clear happy paths, invalid JSON, missing storage values, storage errors with console.warn
reducers.ts Smoke? Needs discussion — unsure if a smoke test is worth adding to verify combined state shape keys and init state, without re testing each child reducer deeply.
store.ts Unit showReduxDevTools() conditions, setupStore() behavior (persisted state precedence, clearState called, dev-tools enhancer toggling)
theme.js Unit remSize, prop success/error states, extend immutability/deep merge, key overrides in contrast theme

Files I'm skipping (browserHistory.js, constants.js, middleware.js) — don't seem to need tests, but open to feedback.


Discussion Questions

1. Which files actually need tests? Are the files in the table above the right ones to focus on, or are some not worth testing? Should reducers.ts get a smoke test?

2. Is this a priority right now? If not, which folders/files in the codebase would benefit most from test coverage first?

3. Should we update testing.md? Currently it's hard to know which files need tests. Would it make sense to add a checklist of all files that need coverage to testing.md in the contributor docs, and check them off as coverage improves? This would make it easier for contributors to pick up testing tasks without guessing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementImprovement to an existing featureNeeds DiscussionRequires further conversation or consensus

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions