-
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
UIPFU-81 - Add jest tests to Filters.js #274
Conversation
This comment has been minimized.
This comment has been minimized.
src/Filters.test.js
Outdated
}); | ||
|
||
it('should call changeHandler on clicking inactive checkbox', async () => { | ||
const inActiveCheckbox = document.querySelector('[ id = "clickable-filter-active-inactive"]'); |
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.
is it possible to find the checkbox using getByRole()
?
|
||
let rtlApi; | ||
|
||
|
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.
remove an extra blank line, please
package.json
Outdated
@@ -48,6 +48,7 @@ | |||
"eslint": "^7.32.0", | |||
"eslint-import-resolver-webpack": "^0.13.2", | |||
"faker": "^4.1.0", | |||
"history": "^5.0.0", |
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.
Hey @Terala-Priyanka, could you change the history
to v4? react-router@5
doesn't support history@5
and it may cause test failures
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.
Hey @BogdanDenis
Thank you for bringing this up.
I have noticed that history
v5 is used with react-router@5
within ui-users
.
It works seamlessly in the workflows too.
Could you please share if there is anything specific about this incompatibility?
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.
@Terala-Priyanka we've had some test errors because history.listen
was called with a slightly different location
argument structure in tests versus in real application. It was a difficult issue to debug because I also assumed that history@5
is supposed to be used with react-router@5
@@ -0,0 +1,80 @@ | |||
import { screen } from '@folio/jest-config-stripes/testing-library/react'; |
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.
Please re-order imports so that first we import third-party modules, then stripes modules, and last is imports from current module. Please also check other files in this PR
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.
Hey @BogdanDenis
Thank you for the insights. I have pushed the change. Could you please re-review it?
Quality Gate passedIssues Measures |
Purpose
UIPFU-81 - Add jest tests to Filters.js
Approach
We are migrating our unit tests to jest.
Currently, we have updated the pipelines to pick Jest tests.
Questions
is it possible to run both the framework tests - jest and bigtest ?
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.