-
Notifications
You must be signed in to change notification settings - Fork 670
add test to EventSinkServicesOverviewList component #3806
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
add test to EventSinkServicesOverviewList component #3806
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.
This is simply asserting that the static markup is returned.
I don't like tests like this because it needs to be kept in sync at all times. Chances are there will never be a breakage in this test unless we explicitly want to change the markup in which case it's a 1:1 change between the markup and the test itself.
cc @rohitkrai03 @andrewballantyne
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.
How is this a useful test? It's asserting that the wrapper exists. I don't believe there is a way to ever make this fail.
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.
Can this simply be expect(wrapper.text().includes('No services found for this resource.')).toBe(true)
That way we're not bound to the markup itself.
Not sure it has much value to test that the class text-muted is set because it's not conditional.
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.
Do wrapper.find(ResourceLink) only once and save it to a variable.
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.
Missing test case for when there is and isn't a sinkUri present.
f750b7a to
b4114f8
Compare
|
@christianvogt |
|
/retest |
1 similar comment
|
/retest |
|
@nemesis09 there is some issue with the build , frontend-ci is failing https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/openshift_console/3806/pull-ci-openshift-console-master-backend/15807 |
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.
Missing newline at end of the file and seems we need to move this in test data, take a look at review docs
__mocks__ folder is for jest mocks https://jestjs.io/docs/en/manual-mocks
Keep test data in the __tests__ dir or re-usable in the src/test/data dir.
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.
Moved the test data to test folder
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.
instead of copying mockEventSourceData again we can update test in test block itself with uri
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.
done
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.
description saysResourceLink and expect is checking ExternalLink. it isn't matching
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.
fixed.
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.
both the test cases have the same description but testing different scenarios
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.
done
b4114f8 to
5236b92
Compare
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.
can you move it inside it block
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.
done
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.
build is still failing, try import * as _ from 'lodash-es'; cc @karthikjeeyar
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 tried loadash-es but yarn lint flags use of loadash-es as error.
36cf0b9 to
2eae165
Compare
|
/hold |
|
/hold cancel |
672f8bb to
17b7d4e
Compare
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.
can we have type of mockEventSourceData?
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.
done
17b7d4e to
9e14414
Compare
|
/test analyze |
9e14414 to
f4876ef
Compare
f4876ef to
138ff4d
Compare
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.
this file i.e test data won't be needed, have refactored it in #3752, Just FYI
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 added a test data to this file in a PR for separate component. So I refactored it there. I could remove the file from this PR as well
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.
you can even just undo changes in Routes* components, will be handled in #3752
|
/kind cleanup |
|
@nemesis09 #3752 got merged so you just need to rebase |
138ff4d to
14e7698
Compare
andrewballantyne
left a comment
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.
Need another test to properly cover the rendering possibilities of EventSinkServiceOverviewList.
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.
Per Christian's comment, need a test to cover the positive path of having a sinkUri.
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.
done
14e7698 to
bfc5e82
Compare
|
/test analyze |
|
/test analyze Bundle size flake... |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, invincibleJai, nemesis09 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR-