-
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-1766 create JEST/RTL for InstanceNotesList.js #2091
base: master
Are you sure you want to change the base?
Conversation
Kudos, SonarCloud Quality Gate passed! |
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.
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.
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 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