Skip to content
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

test: add tests #52

Merged
merged 13 commits into from
Feb 21, 2024
Merged

test: add tests #52

merged 13 commits into from
Feb 21, 2024

Conversation

pixelass
Copy link
Member

Motivation

adds test for hooks
also sets up workflows for PRs

Issues closed

closes #22

Modified Jest configuration to use automatic runtime transformation for React and JSdom as test environment. Additionally, adjusted moduleNameMapper to correctly map the project structure.
Simplified the implementation of Keyboard navigation hooks by reducing redundancy in callback functions. Also, renamed from .tsx to .ts since it contains no JSX syntax. Additionally, modified import statement to import useAtom directly from 'jotai' instead of 'jotai/index'.
Introduced test files for the 'useSsrColorScheme', 'useColumns', 'useKeyboardControlledImagesNavigation', and 'useScrollPosition' hooks. These tests cover functionalities such as initial mode setting, mode changing, keyboard navigation, and scroll position detection.
The Jest configuration and setup files have been split into separate ones for client and Electron app testing. This will allow distinct test configuration and match patterns for the two different environments. Furthermore, corresponding changes are made in the package.json file to add different test scripts for running these new configuration files.
Renamed all test directories in src/client/ions/hooks path from "__test__" to "__tests__" to follow naming conventions. This change ensures a consistent file structure, which might have been causing issues in identifying and running test files.
Three new workflows have been added for GitHub Actions to run client, e2e, and electron tests. They are configured to trigger on push events to alpha, beta, rc, and main branches or on pull requests to those same branches. All workflows run on the latest version of Ubuntu and use Node.js version 18.x.
@pixelass pixelass merged commit ac522fe into alpha Feb 21, 2024
3 checks passed
@pixelass pixelass deleted the test/hooks branch February 21, 2024 21:44
Copy link

🎉 This PR is included in version 1.0.0-alpha.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant