test(components): add tests for Input, TextField, TextArea, Search, EDSProvider - #218
Conversation
…DSProvider Batch 2 of issue #214's component test rollout — 46 tests across 5 suites. Duplicates the shared test infra from batch-1 (test-utils render helper, @expo/vector-icons mock, @types/react-test-renderer) since this branch was deliberately created independently of batch-1's branch, off main post-#215. Narrows jest.config.cjs's untested-component checklist the same way batch-1 did: drops Input, Search, TextArea, TextField, EDSProvider (now tested) plus the permanently-excluded internal/deprecated components.
…ng it
Input set accessibilityState={{ disabled }} after spreading {...rest}, so
any caller-supplied accessibilityState was silently discarded. Button and
TextArea already merge the caller's value in — Input didn't.
Fixes #217
…merge Verified this test fails against the pre-fix Input.tsx and passes against the fix from the previous commit.
|
@claude review |
|
Claude finished @Chibuzor-Nwemambu's task in 2m 3s —— View job Review — PR #218
This is a well-crafted PR. The tests are behavior-focused (query by placeholder/label/text rather than internals), the comments explain the non-obvious bits ( LGTM. A few observations, none blocking. 1. The
|
…yState merges (#221) ## Summary - Flips the `accessibilityState` merge order in `Button`, `IconButton`, `Input`, and `TextArea` so the component's own computed `disabled` always wins over a caller-supplied `accessibilityState.disabled`, instead of the other way around. - `disabled` drives real behavior (`editable`, styling) — letting a caller's `accessibilityState` disagree with it can mislead assistive technology users specifically (e.g. a screen reader announcing "disabled" on a field that's actually fully interactive, or vice versa). No realistic legitimate use case was found for allowing that disagreement. - Other `accessibilityState` keys (`selected`, `expanded`, `checked`, etc.) are untouched and remain fully caller-overridable — this only changes `disabled`. - `TextField`/`Search` both wrap `Input` and forward `accessibilityState` through `{...rest}`, so they inherit the fix automatically with no changes of their own. - `Input.tsx` here is written directly as the final, complete form (merges *and* the component's `disabled` wins) — `main` never had #217's partial fix, only `214-batch-2-tests` did, and that partial fix has now been reverted there in favor of this being the single, canonical fix. This PR fully supersedes and closes #217. - Source-only change, no test files touched — regression tests are being added as a follow-up directly into PR #216 (`Button.test.tsx`, currently zero coverage of this) and PR #218 (`Input.test.tsx`/`TextArea.test.tsx`, currently zero coverage of this after the #217 partial-fix revert) once this PR merges. Fixes #220. Fixes #217. ## Test plan - [x] `pnpm lint` — clean - [x] `pnpm check-types` — clean - [x] `pnpm build` — clean - [ ] Regression tests to be added to PR #216 and PR #218 as a follow-up once this merges (this PR intentionally has no test changes, per the agreed atomic-commit split)
…nput/TextArea Covers #221's fix (now merged): a caller-supplied accessibilityState merges with the component's own computed disabled value, with disabled winning on conflict. One consolidated test per component rather than separate #217/#220 tests, since they're one fix now. Verified each test fails against its respective pre-#221 source (Input's original no-merge-at-all code, TextArea's original caller-wins-on-conflict code) and passes against the fix.
|
@claude review |
|
Claude finished @Chibuzor-Nwemambu's task in 1m 36s —— View job Re-review — PR #218
Re-reviewed since my first pass. Two of the three follow-ups I raised have been resolved by the new commits, and CI is green (PR Check ✅ ×2 + build ✅). LGTM — nothing blocking. ✅ Prior item #1 (caller could override the component's own
|
Summary
test-utils.tsx,@expo/vector-iconsmock,@types/react-test-renderer) duplicated from batch-1's branch, since this branch was deliberately created independent of batch-1 (branched offmainpost-test(components): add Jest test infrastructure #215, not off214-batch-1-tests).jest.config.cjs's untested-component checklist the same way batch-1 did.Input/TextArea'saccessibilityStatemerge — one consolidated test per component (not separate fix(components): Input clobbers a caller-supplied accessibilityState instead of merging it #217/fix(components): component's own disabled state should always win over caller-supplied accessibilityState.disabled #220 tests, since they're one fix now), each verified to fail against its respective pre-fix(components): make component's own disabled state win accessibilityState merges #221 source before the fix.Note: this PR previously included an isolated fix for #217 (
Input.tsx'saccessibilityStateclobbering caller-supplied values) plus its regression test. Both were reverted — the fix turned out to be incomplete (it stopped caller values from being clobbered, but still let a caller'sdisabledwin over the component's own computed value on conflict). That's now fixed properly, in one place, by #221, which superseded and closed #217 as well.Contributes to #214 — does not close it (SelectionControls and the new-component-workflow update are still outstanding).
Test plan
pnpm test— 48/48 passing across 5 suitespnpm lint— cleanpnpm check-types— cleanpnpm build— clean