UIIN-1671 create JEST/RTL for ItemsListRow.js#2090
UIIN-1671 create JEST/RTL for ItemsListRow.js#2090ssandupatla wants to merge 2 commits intomasterfrom
Conversation
zburke
left a comment
There was a problem hiding this comment.
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.
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.
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.
I don't understand how the description "isDragging ... is false" relates to the expect clause.
There was a problem hiding this comment.
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