Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ssandupatla
Copy link
Contributor

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

@github-actions
Copy link

github-actions bot commented Mar 29, 2023

Jest Unit Test Statistics

    1 files  ±    0  200 suites  +34   8m 29s ⏱️ +53s
606 tests +100  606 ✔️ +100  0 💤 ±0  0 ±0 
611 runs  +101  611 ✔️ +101  0 💤 ±0  0 ±0 

Results for commit f8b2988. ± Comparison against base commit a12a91c.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 29, 2023

BigTest Unit Test Statistics

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit f8b2988. ± Comparison against base commit a12a91c.

♻️ This comment has been updated with latest results.

@sonarcloud
Copy link

sonarcloud bot commented Mar 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@zburke zburke left a 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.

Comment on lines 38 to 41
it('should render the noValue component when notes is empty', () => {
const { getByText } = renderInstanceNotesList(noValueProps);
expect(getByText('test-notes')).toBeInTheDocument();
});
Copy link
Member

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.

@sonarcloud
Copy link

sonarcloud bot commented May 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants