Skip to content

Conversation

@nemesis09
Copy link
Contributor

This PR-

  • adds unit tests to EventSinkServicesOverviewList component
    event-test

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 18, 2019
@openshift-ci-robot openshift-ci-robot added the component/knative Related to knative-plugin label Dec 18, 2019
Comment on lines 16 to 24
Copy link
Contributor

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

Comment on lines 11 to 15
Copy link
Contributor

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.

Comment on lines 29 to 41
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

@nemesis09 nemesis09 force-pushed the test-event-source-overview branch from f750b7a to b4114f8 Compare December 19, 2019 22:11
@nemesis09
Copy link
Contributor Author

@christianvogt
I have made changes addressing the reviews. PTAL

@nemesis09
Copy link
Contributor Author

/retest

1 similar comment
@nemesis09
Copy link
Contributor Author

/retest

@invincibleJai
Copy link
Member

invincibleJai commented Dec 20, 2019

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 22 to 37
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@nemesis09 nemesis09 force-pushed the test-event-source-overview branch from b4114f8 to 5236b92 Compare December 24, 2019 00:49
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@invincibleJai invincibleJai Dec 24, 2019

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

Copy link
Contributor Author

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.

@nemesis09 nemesis09 force-pushed the test-event-source-overview branch 2 times, most recently from 36cf0b9 to 2eae165 Compare December 24, 2019 10:34
@nemesis09
Copy link
Contributor Author

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 24, 2019
@nemesis09
Copy link
Contributor Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 24, 2019
@nemesis09 nemesis09 force-pushed the test-event-source-overview branch 2 times, most recently from 672f8bb to 17b7d4e Compare December 24, 2019 13:28
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@nemesis09 nemesis09 force-pushed the test-event-source-overview branch from 17b7d4e to 9e14414 Compare December 27, 2019 10:10
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 27, 2019
@nemesis09
Copy link
Contributor Author

/test analyze

@nemesis09 nemesis09 force-pushed the test-event-source-overview branch from 9e14414 to f4876ef Compare December 31, 2019 01:05
@openshift-ci-robot openshift-ci-robot added the component/dev-console Related to dev-console label Dec 31, 2019
@nemesis09 nemesis09 force-pushed the test-event-source-overview branch from f4876ef to 138ff4d Compare December 31, 2019 12:24
Copy link
Member

@invincibleJai invincibleJai Jan 2, 2020

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

Copy link
Contributor Author

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

Copy link
Member

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

@andrewballantyne
Copy link
Contributor

/kind cleanup

@openshift-ci-robot openshift-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jan 2, 2020
@invincibleJai
Copy link
Member

@nemesis09 #3752 got merged so you just need to rebase

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 3, 2020
@nemesis09 nemesis09 force-pushed the test-event-source-overview branch from 138ff4d to 14e7698 Compare January 3, 2020 23:36
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 3, 2020
Copy link
Contributor

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

Comment on lines +26 to +37
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@nemesis09 nemesis09 force-pushed the test-event-source-overview branch from 14e7698 to bfc5e82 Compare January 7, 2020 11:48
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2020
@andrewballantyne
Copy link
Contributor

/test analyze

@andrewballantyne
Copy link
Contributor

/test analyze

Bundle size flake...

@invincibleJai
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 8, 2020
@openshift-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 777acdf into openshift:master Jan 8, 2020
@spadgett spadgett added this to the v4.4 milestone Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/dev-console Related to dev-console component/knative Related to knative-plugin kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants