@thepalaceproject/circulation-admin 1.46.0-post.1 → 1.46.0-post.2

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__/`.