You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flagged during the Divider PR review (#207) — there is currently no test infrastructure for components in the library. The absence of tests has been consistent with the existing convention, but as the library matures this needs to be addressed.
Decision
Set up test infrastructure for packages/components
Write tests for all existing components
Add test file creation to the new component workflow so tests are written alongside the component from the start, not as an afterthought
Test stack
Jest as the test runner — the mature option for React Native native-module mocking
React Native Testing Library (RNTL) for querying and interacting with components
jest-expo preset — covers mocks for Expo/RN native modules used by peer deps (expo-font, react-native-reanimated, react-native-gesture-handler, react-native-svg)
Behavior-focused tests (render/query/fireEvent/assert), not snapshot tests — snapshots churn noisily during the ongoing token/style migration and don't catch real behavioral regressions
Scope
Existing components to cover
Button
Badge
Divider
Input
Link
Search
TextArea
TextField
SelectionControls (Switch, Radio, Checkbox)
Typography
EDSProvider
New component workflow
Update the component creation script/workflow to scaffold a ComponentName.test.tsx file alongside the component, so every new component ships with a test file from day one.
PR breakdown
Work is split across multiple branches/PRs against this single issue rather than GitHub sub-issues. Checking items off here as each PR merges:
Background
Flagged during the Divider PR review (#207) — there is currently no test infrastructure for components in the library. The absence of tests has been consistent with the existing convention, but as the library matures this needs to be addressed.
Decision
packages/componentsTest stack
jest-expopreset — covers mocks for Expo/RN native modules used by peer deps (expo-font,react-native-reanimated,react-native-gesture-handler,react-native-svg)Scope
Existing components to cover
New component workflow
Update the component creation script/workflow to scaffold a
ComponentName.test.tsxfile alongside the component, so every new component ships with a test file from day one.PR breakdown
Work is split across multiple branches/PRs against this single issue rather than GitHub sub-issues. Checking items off here as each PR merges:
ComponentName.test.tsxfor future components) — PR docs(components): scaffold test files in the new component workflow #225 (open, awaiting review) — closes this issueReferences