-
Notifications
You must be signed in to change notification settings - Fork 18
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
UIIN-1671 create JEST/RTL for ItemsListRow.js #2090
base: master
Are you sure you want to change the base?
Conversation
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 two test descriptions suggest testing opposite conditions (isDragging should be true, then isDragging should be false) and use the two different mock implementations of react-beautiful-dnd. OK, that part makes sense. But then you should be checking the same condition in both places, i.e. assert that something is true in the first test, then false in the second test. Alternatively, if you can't leverage the same element for both tests, then include both expect
clauses in both tests and check that their conditions flip, e.g.
it('test 1', () => {
expect(first condition).toBeInTheDocument();
expect(second condition).not.toBeInTheDocument();
});
it('test 2', () => {
expect(first condition).not.toBeInTheDocument();
expect(second condition).toBeInTheDocument();
});
|
||
|
||
describe('ItemsListRow', () => { | ||
it('new mo should render isDragging of snapshot is true', () => { |
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.
I don't understand what "new mo" means; is this a typo? I don't understand how the description "isDragging ... is true" relates to the expect clause
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.
We have cleared all typos. Changes made as per your suggestions. Updated test description.
it('child should render isDragging of snapshot is false', () => { | ||
renderItemsListRow(defaultProps); | ||
expect(screen.getByRole('row', { name: 'cell 1cell 2cell 3' })).toBeInTheDocument(); |
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.
I don't understand how the description "isDragging ... is false" relates to the expect clause.
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.
We have cleared all typos. Changes made as per your suggestions.
Update js file
Kudos, SonarCloud Quality Gate passed! |
REFS: UIIN-1671 create JEST/RTL for ItemsListRow.js
URL: https://issues.folio.org/browse/UIIN-1671