@thepalaceproject/circulation-admin 1.46.0 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -77,7 +77,7 @@ Helpers in `tests/jest/testUtils/`:
77
77
 
78
78
  - Render the **connected default export**, not the unconnected named export, or `mapStateToProps`/`mapDispatchToProps` never run and their coverage is lost. Mocking a connected child in a parent's test drops that child's wiring the same way — cover the child in its own test.
79
79
  - Unhandled rejections fail the run: stub `fetch` and `await` a `findBy*` so on-mount fetches settle before the test ends.
80
- - `EditableInput` renders label and input as siblings with no `htmlFor`, so reach for `getByText`, not `getByLabelText`.
80
+ - Query form fields by their accessible label, as a screen reader would: `getByRole("textbox", { name: /Label/i })` or `getByLabelText(/Label/i)`. The role follows what `EditableInput` renders: `elementType="select"` is a `combobox`, and `type="checkbox"` or `"radio"` are those roles. A passing query proves the field is labeled. `EditableInput` nests the input inside its `<label>`, so both work, but use a regex: a required field's label text includes "Required". An `EditableInput` with no `label` prop may still have an accessible name through `aria-label`. If it has no accessible name, treat that as an accessibility bug in the component, not something to work around in the test.
81
81
  - Mock react-router's `Link` as a `<div>`, not an `<a>` (jsx-a11y). Mock default exports as `{__esModule: true, default: ...}`.
82
82
 
83
83
  **Environment:** `jest-fixed-jsdom` restores Node's `fetch`/`Response` globals so MSW can intercept them; `jest.polyfills.js` runs first via `setupFiles`. `testEnvironmentOptions.customExportConditions: [""]` keeps jsdom's default `["browser"]` condition from resolving ESM-only dependency bundles that ts-jest cannot transform. `moduleNameMapper` stubs asset, style, and markdown imports out to `tests/__mocks__/`.
@@ -91,7 +91,7 @@ Helpers in `tests/jest/testUtils/`:
91
91
 
92
92
  ## Code Style
93
93
 
94
- - Prettier: double quotes, semicolons, trailing commas (es5), 80 char width
94
+ - Prettier (double quotes, semicolons, trailing commas (es5), printWidth 80) and ESLint are authoritative for formatting and style. The husky pre-commit hook auto-formats staged files with Prettier, and CI runs ESLint (`npm run lint:js`), so do not flag or hand-verify formatting. printWidth is a soft target, not a hard limit; lines Prettier leaves longer than 80 (e.g., interface `extends` clauses) are fine, and there is no ESLint max-len rule.
95
95
  - ESLint (flat config, `eslint.config.mjs`) with `jsx-a11y/strict` — runs on the whole tree in CI via `npm run lint:js` (`eslint . --max-warnings 0`, so warnings fail the build) and on staged files via the husky pre-commit hook. `npm run lint` runs ESLint (`lint:js`) followed by sass-lint.
96
96
  - `@typescript-eslint/no-explicit-any` is disabled (any is allowed)
97
97
  - Prefer template literals over string concatenation for building strings with variables