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

Add tests for Card component #631

Merged
merged 3 commits into from
Sep 14, 2018
Merged

Conversation

andresmgot
Copy link
Contributor

closes #630


it("should render the children elements", () => {
const children = <div>foo</div>;
const wrapper = shallow(<Card children={children} />);
Copy link
Contributor

@prydonius prydonius Sep 13, 2018

Choose a reason for hiding this comment

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

can we change this to <Card><div>foo</div></Card> or <Card>{children}</Card>? We shouldn't really use the children prop directly.


it("should render the children elements", () => {
const children = <div>foo</div>;
const wrapper = shallow(<CardContent children={children} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing about children prop


it("should render the children elements", () => {
const children = <div>foo</div>;
const wrapper = shallow(<CardFooter children={children} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing about children prop


it("should render the children elements", () => {
const children = <div>foo</div>;
const wrapper = shallow(<CardGrid children={children} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing about children prop


it("should render the className", () => {
const wrapper = shallow(<CardGrid className="foo" />);
expect(wrapper.find(".foo").exists()).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

expect(wrapper.find(".foo")).toExist()


exports[`cssClass should render with the default class 1`] = `
<article
className="Card undefined"
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the undefined class - looks like a bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, I didn't see that.


exports[`should render the children elements 1`] = `
<div
className="Card__content padding-normal undefined"
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing with undefined


exports[`should render the children elements 1`] = `
<div
className="Card__footer padding-h-normal undefined"
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing with undefined


exports[`should render the children elements 1`] = `
<div
className="CardGrid padding-v-big undefined"
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing with undefined

@andresmgot andresmgot merged commit c4cfe88 into vmware-tanzu:master Sep 14, 2018
@andresmgot andresmgot deleted the CardTests branch September 14, 2018 11:01
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] Card component
2 participants