', () => {
+ const handleClick = sandbox.spy()
+ const wrapper = shallow(
)
+
+ wrapper.should.have.tagName('a')
+ })
+
+ it('is called with (event) on click', () => {
+ const handleClick = sandbox.spy()
+ const wrapper = mount(
)
+
+ wrapper.simulate('click')
+
+ handleClick.should.have.been.calledOnce()
+ handleClick.should.have.been.calledWithMatch({})
+ })
+ })
+
+ describe('extra prop', () => {
+ it('renders an CardContent component', () => {
+ const wrapper = shallow(
)
+
+ wrapper.should.have.descendants('CardContent')
+ })
+ })
+})
diff --git a/test/specs/views/Card/CardContent-test.js b/test/specs/views/Card/CardContent-test.js
new file mode 100644
index 0000000000..940bdcd604
--- /dev/null
+++ b/test/specs/views/Card/CardContent-test.js
@@ -0,0 +1,41 @@
+import faker from 'faker'
+import React from 'react'
+
+import * as common from 'test/specs/commonTests'
+import CardContent from 'src/views/Card/CardContent'
+import CardDescription from 'src/views/Card/CardDescription'
+import CardHeader from 'src/views/Card/CardHeader'
+import CardMeta from 'src/views/Card/CardMeta'
+
+describe('CardContent', () => {
+ common.isConformant(CardContent)
+ common.propKeyOnlyToClassName(CardContent, 'extra')
+ common.rendersChildren(CardContent)
+
+ describe('description prop', () => {
+ it('renders description component', () => {
+ const text = faker.hacker.phrase()
+
+ shallow(
)
+ .should.contain(
)
+ })
+ })
+
+ describe('header prop', () => {
+ it('renders header component', () => {
+ const text = faker.hacker.phrase()
+
+ shallow(
)
+ .should.contain(
)
+ })
+ })
+
+ describe('meta prop', () => {
+ it('renders meta component', () => {
+ const text = faker.hacker.phrase()
+
+ shallow(
)
+ .should.contain(
)
+ })
+ })
+})
diff --git a/test/specs/views/Card/CardDescription-test.js b/test/specs/views/Card/CardDescription-test.js
new file mode 100644
index 0000000000..004ac4db9d
--- /dev/null
+++ b/test/specs/views/Card/CardDescription-test.js
@@ -0,0 +1,26 @@
+import faker from 'faker'
+import React from 'react'
+
+import * as common from 'test/specs/commonTests'
+import CardDescription from 'src/views/Card/CardDescription'
+
+describe('CardDescription', () => {
+ common.isConformant(CardDescription)
+ common.rendersChildren(CardDescription)
+
+ describe('description prop', () => {
+ it('renders child text', () => {
+ const text = faker.hacker.phrase()
+
+ shallow(
)
+ .should.contain.text(text)
+ })
+
+ it('renders child node', () => {
+ const child =
+
+ shallow(
)
+ .should.contain(child)
+ })
+ })
+})
diff --git a/test/specs/views/Card/CardGroup-test.js b/test/specs/views/Card/CardGroup-test.js
new file mode 100644
index 0000000000..90126db732
--- /dev/null
+++ b/test/specs/views/Card/CardGroup-test.js
@@ -0,0 +1,30 @@
+import faker from 'faker'
+import React from 'react'
+import * as common from 'test/specs/commonTests'
+import CardGroup from 'src/views/Card/CardGroup'
+
+describe('CardGroup', () => {
+ common.isConformant(CardGroup)
+ common.hasUIClassName(CardGroup)
+ common.propKeyOnlyToClassName(CardGroup, 'doubling')
+ common.propKeyOnlyToClassName(CardGroup, 'stackable')
+ common.implementsNumberToWordProp(CardGroup, 'itemsPerRow')
+ common.rendersChildren(CardGroup)
+
+ describe('renders children', () => {
+ const firstText = faker.hacker.phrase()
+ const secondText = faker.hacker.phrase()
+
+ it('with `items` prop', () => {
+ const items = [
+ { header: firstText },
+ { header: secondText },
+ ]
+
+ const wrapper = mount(
).find('Card')
+
+ wrapper.first().find('CardHeader').should.contain.text(firstText)
+ wrapper.last().find('CardHeader').should.contain.text(secondText)
+ })
+ })
+})
diff --git a/test/specs/views/Card/CardHeader-test.js b/test/specs/views/Card/CardHeader-test.js
new file mode 100644
index 0000000000..30ab01ca53
--- /dev/null
+++ b/test/specs/views/Card/CardHeader-test.js
@@ -0,0 +1,26 @@
+import faker from 'faker'
+import React from 'react'
+
+import * as common from 'test/specs/commonTests'
+import CardHeader from 'src/views/Card/CardHeader'
+
+describe('CardHeader', () => {
+ common.isConformant(CardHeader)
+ common.rendersChildren(CardHeader)
+
+ describe('description prop', () => {
+ it('renders child text', () => {
+ const text = faker.hacker.phrase()
+
+ shallow(
)
+ .should.contain.text(text)
+ })
+
+ it('renders child node', () => {
+ const child =
+
+ shallow(
)
+ .should.contain(child)
+ })
+ })
+})
diff --git a/test/specs/views/Card/CardMeta-test.js b/test/specs/views/Card/CardMeta-test.js
new file mode 100644
index 0000000000..ce675b90a4
--- /dev/null
+++ b/test/specs/views/Card/CardMeta-test.js
@@ -0,0 +1,26 @@
+import faker from 'faker'
+import React from 'react'
+
+import * as common from 'test/specs/commonTests'
+import CardMeta from 'src/views/Card/CardMeta'
+
+describe('CardMeta', () => {
+ common.isConformant(CardMeta)
+ common.rendersChildren(CardMeta)
+
+ describe('description prop', () => {
+ it('renders child text', () => {
+ const text = faker.hacker.phrase()
+
+ shallow(
)
+ .should.contain.text(text)
+ })
+
+ it('renders child node', () => {
+ const child =
+
+ shallow(
)
+ .should.contain(child)
+ })
+ })
+})