-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add testing #35
Merged
Merged
Add testing #35
Conversation
This file contains 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
…separate workflow file
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…eb server settings
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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
No code testing.
What is the new behavior?
This pull request includes several changes to enhance the testing framework, update the build and test workflow, and add mock data for API testing. The most important changes are the addition of new tests, updates to the GitHub Actions workflow, and the introduction of mock data for more comprehensive testing.
Testing Enhancements:
app/__tests__/home.spec.ts
: Added Playwright tests for meta tags and theme toggle functionality.hooks/__tests__/useArea.test.tsx
: Introduced tests for theuseArea
hook to ensure it returns the correct data based on the provided arguments.hooks/__tests__/useDoubleTap.test.ts
: Added tests for theuseDoubleTap
hook to verify its behavior on double-tap events.lib/__tests__/queryClient.test.ts
: Implemented tests for thegetQueryClient
function to validate its configuration.lib/__tests__/utils.test.ts
: Added unit tests for various utility functions, includingdebounce
,objectToEntries
, anddetermineAreaByCode
.Workflow Updates:
.github/workflows/main.yml
: Updated the workflow to include build steps and added an environment variable for Vercel URL. Also, introduced a new job for running end-to-end tests using Playwright. [1] [2] [3]Mock Data and API Testing:
app/api/__mocks__/const.ts
: Added mock data for provinces, regencies, districts, villages, and islands to be used in API tests.app/api/__mocks__/handlers.ts
: Created mock handlers for API endpoints to return the mock data based on the request parameters.app/api/__mocks__/server.ts
: Set up a mock server usingmsw
to intercept and handle API requests during tests.Minor Updates:
components/theme-toggle.tsx
: Added adata-testid
attribute to the theme toggle button for easier selection in tests.lib/utils.ts
: Added validation checks in thedebounce
function to ensure the callback is a function and the delay is a positive number.Other information
None