-
-
Notifications
You must be signed in to change notification settings - Fork 5
[TWRNC] Added test suite #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ BugBot reviewed your changes and found no bugs!
Was this report helpful? Give feedback by reacting with 👍 or 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
flattenColors
function
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) { |
Copilot uses AI. Check for mistakes.
@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