Conversation
📖 Storybook Preview |
📖 Storybook Preview |
…n-system into chore/twrnc-test
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
📖 Storybook Preview |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive test suite for the @metamask/design-system-twrnc-preset package, addressing issue #732. The test suite includes complete coverage for all major components and functionality of the design system preset.
- Adds unit tests for all modules including typography, colors, themes, hooks, and configuration generation
- Adds test infrastructure with Jest configuration and proper coverage settings
- Includes a minor bug fix in the colors module's
flattenColorsfunction
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/typography.types.test.ts | Tests for typography type definitions and interfaces |
| src/typography.test.ts | Tests for typography configuration and design tokens |
| src/tailwind.config.test.ts | Tests for Tailwind configuration generation logic |
| src/index.test.ts | Tests for package exports and public API |
| src/hooks.test.tsx | Tests for React hooks (useTheme, useTailwind) |
| src/colors.test.ts | Tests for color system and theme color handling |
| src/ThemeProvider.test.tsx | Tests for React context provider component |
| src/Theme.types.test.ts | Tests for theme enum and type definitions |
| src/colors.ts | Bug fix for flattenColors function logic |
| package.json | Added react-native dev dependency for testing |
| jest.config.js | Updated Jest configuration with coverage settings |
| } | ||
|
|
||
| if (typeof value === 'object' && value !== null) { |
There was a problem hiding this comment.
The logic change from else if to separate if statements will cause string values to be processed twice - once as strings and once as potential objects. This could lead to incorrect flattening behavior where string values might be treated as objects if they have object-like properties.
| } | |
| if (typeof value === 'object' && value !== null) { | |
| } else if (typeof value === 'object' && value !== null) { |
|
@cursoragent review |
Description
This PR adds a comprehensive test suite for the package @metamask/design-system-twrnc-preset
Related issues
Fixes: #732
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist