Add unit and integration tests for components and update build config (Step 4)#151
Open
milindmore22 wants to merge 12 commits into
Open
Add unit and integration tests for components and update build config (Step 4)#151milindmore22 wants to merge 12 commits into
milindmore22 wants to merge 12 commits into
Conversation
…iteSettings, S3Credentials, GitHubRepoToken)
milindmore22
marked this pull request as ready for review
July 6, 2026 12:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR adds comprehensive unit tests for several core JavaScript React components (
OnboardingScreen,SettingsPage,GitHubRepoToken, andPluginCard) and updates the Codecov configuration to exclude specific frontend files from coverage reporting.Why
These changes are necessary to improve the overall test coverage, reliability, and stability of the frontend components. Additionally, updating the
.codecov.ymlconfiguration ensures that our coverage metrics are accurate by removing files that do not require testing (such as icons) from the coverage calculations.Related Issue(s):
Covers Step 4 : https://github.com/rtCamp/OnePress/issues/78
Step 1 : #149
How
The improvements were implemented through the following updates:
OnboardingScreen: Added unit tests covering site type loading, error handling, saving, and redirection logic.SettingsPage: Added unit tests covering site management, error notices, and conditional rendering for different site types (child components were mocked for test isolation).GitHubRepoToken: Added unit tests to verify token fetching, input changes, API interactions, and error handling.PluginCard: Added unit tests for rendering, selection, version changes, and callback invocations..github/.codecov.ymlto ignore all files inassets/src/components/icons/and JavaScript files inassets/src/js/.Testing Instructions
npm run test:jsornpm run test:js:coverage).OnboardingScreen,SettingsPage,GitHubRepoToken, andPluginCardpass successfully.assets/src/components/icons/andassets/src/js/directories.Screenshots
N/A - This PR focuses on unit tests and configuration files.
Additional Info
N/A
Checklist