-
Notifications
You must be signed in to change notification settings - Fork 705
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
Conversation
|
||
it("should render the children elements", () => { | ||
const children = <div>foo</div>; | ||
const wrapper = shallow(<Card children={children} />); |
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 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} />); |
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.
same thing about children prop
|
||
it("should render the children elements", () => { | ||
const children = <div>foo</div>; | ||
const wrapper = shallow(<CardFooter children={children} />); |
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.
same thing about children prop
|
||
it("should render the children elements", () => { | ||
const children = <div>foo</div>; | ||
const wrapper = shallow(<CardGrid children={children} />); |
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.
same thing about children prop
|
||
it("should render the className", () => { | ||
const wrapper = shallow(<CardGrid className="foo" />); | ||
expect(wrapper.find(".foo").exists()).toBe(true); |
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.
expect(wrapper.find(".foo")).toExist()
|
||
exports[`cssClass should render with the default class 1`] = ` | ||
<article | ||
className="Card undefined" |
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.
what's the undefined class - looks like a bug?
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.
good catch, I didn't see that.
|
||
exports[`should render the children elements 1`] = ` | ||
<div | ||
className="Card__content padding-normal undefined" |
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.
same thing with undefined
|
||
exports[`should render the children elements 1`] = ` | ||
<div | ||
className="Card__footer padding-h-normal undefined" |
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.
same thing with undefined
|
||
exports[`should render the children elements 1`] = ` | ||
<div | ||
className="CardGrid padding-v-big undefined" |
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.
same thing with undefined
closes #630