UIIN-1766 create JEST/RTL for InstanceNotesList.js#2091
UIIN-1766 create JEST/RTL for InstanceNotesList.js#2091ssandupatla wants to merge 2 commits intomasterfrom
Conversation
|
Kudos, SonarCloud Quality Gate passed! |
zburke
left a comment
There was a problem hiding this comment.
If you comment out all the expect clauses in these tests, you'll still see 100% coverage. Running the code isn't the same as asserting on it. To test whether it will "render the noValue component when notes is empty", assert on the absence of a (mocked) noValue when notes is populated and on the presence of noValue when notes is empty.
| it('should render the noValue component when notes is empty', () => { | ||
| const { getByText } = renderInstanceNotesList(noValueProps); | ||
| expect(getByText('test-notes')).toBeInTheDocument(); | ||
| }); |
There was a problem hiding this comment.
I don't understand how this test is related to the noValue component. Rather, it validates that the note's type is used as a column header, which is the same thing tested on line 33. From a coverage point of view, you're running the noValue code here, but not asserting on it. Effectively that throws away the value of the test.
|
Kudos, SonarCloud Quality Gate passed! |








REFS: UIIN-1766 create JEST/RTL for InstanceNotesList.js
URL: https://issues.folio.org/browse/UIIN-1766