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

AppList and AppListItem render tests #519

Merged
merged 2 commits into from
Aug 23, 2018

Conversation

andresmgot
Copy link
Contributor

@andresmgot andresmgot commented Aug 22, 2018

Basic unit tests

fixes #518

Copy link
Contributor

@migmartri migmartri left a comment

Choose a reason for hiding this comment

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

Thank you!

const wrapper = shallow(
<AppList
apps={
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Something that helps me to avoid repetition is the creation of a set of defaultProps and then detructure them. You might want to do the same.

i.e https://github.com/kubeapps/kubeapps/pull/517/files#diff-cd0c667e32f8b8a10aafee7539cff08cR15

Copy link
Contributor

@prydonius prydonius left a comment

Choose a reason for hiding this comment

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

nice, thanks!

import AppList from "./AppList";
import AppListItem from "./AppListItem";

it("renders a loading message if the app overview is not ready", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I had to figure out what "app overview is not ready" meant, maybe just "if apps object is empty" is easier to understand?

filter=""
/>,
);
expect(
Copy link
Contributor

Choose a reason for hiding this comment

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

a snapshot might be easier here than having to check for this exact text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, in this case it'll be handy

@andresmgot andresmgot merged commit 243eeb0 into vmware-tanzu:master Aug 23, 2018
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.

[unit tests] AppList and AppListItem unit tests
3 participants