processing / processing/p5.js-web-editor

discussion: adding unit/integration tests for client . files

Open
#4,068 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Needs Discussion
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed coverage for i18n.js, persistState.ts, reducers.ts, store.ts, and theme.js, along with the files proposed for skipping. Resolve which files and behaviors should be covered, including whether reducers.ts needs a smoke test and whether testing.md should be updated; done means the scope is agreed and the selected tests are added.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.