- {displayOnOffLabel && isSelected &&
}
- {displayOnOffLabel && !isSelected &&
}
-
+
+ {displayOnOffLabel && isSelected &&
}
+ {displayOnOffLabel && !isSelected &&
}
+
)
}
diff --git a/src/components/Buttons/__tests__/Button.spec.js b/src/components/Buttons/__tests__/Button.spec.js
index 737d5fc6..3a732a74 100644
--- a/src/components/Buttons/__tests__/Button.spec.js
+++ b/src/components/Buttons/__tests__/Button.spec.js
@@ -1,6 +1,5 @@
import React from 'react'
import renderer from 'react-test-renderer'
-import { StyleRoot } from 'radium'
import { mount } from 'enzyme'
import { spy } from 'sinon'
import Icon from '../../Icon/Icon'
@@ -16,13 +15,7 @@ describe('Button', () => {
]
testCases.forEach(props => {
- const tree = renderer
- .create(
-
-
-
- )
- .toJSON()
+ const tree = renderer.create(
).toJSON()
expect(tree).toMatchSnapshot()
})
})
@@ -36,13 +29,7 @@ describe('Button', () => {
]
testCases.forEach(props => {
- const tree = renderer
- .create(
-
-
-
- )
- .toJSON()
+ const tree = renderer.create(
).toJSON()
expect(tree).toMatchSnapshot()
})
})
@@ -50,11 +37,9 @@ describe('Button', () => {
it('renders with inverted colors', () => {
const tree = renderer
.create(
-
-
-
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -69,13 +54,7 @@ describe('Button', () => {
]
testCases.forEach(props => {
- const tree = renderer
- .create(
-
-
-
- )
- .toJSON()
+ const tree = renderer.create(
).toJSON()
expect(tree).toMatchSnapshot()
})
})
@@ -83,11 +62,9 @@ describe('Button', () => {
it('applies the elementAttributes prop correctly', () => {
const tree = renderer
.create(
-
-
-
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -96,13 +73,11 @@ describe('Button', () => {
it('fires the onClick prop', () => {
const onClick = spy()
const wrapper = mount(
-
-
-
-
-
+
+
+
)
wrapper.find('button').simulate('click')
@@ -113,11 +88,9 @@ describe('Button', () => {
it('renders correctly when disabled', () => {
const tree = renderer
.create(
-
-
-
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -126,11 +99,9 @@ describe('Button', () => {
it('does not fire the onClick prop when disabled', () => {
const onClick = spy()
const wrapper = mount(
-
-
-
+
)
wrapper.find('button').simulate('click')
@@ -140,11 +111,9 @@ describe('Button', () => {
it('can render as a link if an href is provided', () => {
const tree = renderer.create(
-
-
-
+
)
expect(tree).toMatchSnapshot()
})
diff --git a/src/components/Buttons/__tests__/CircleButton.spec.js b/src/components/Buttons/__tests__/CircleButton.spec.js
index 7c5029e3..0b7da9eb 100644
--- a/src/components/Buttons/__tests__/CircleButton.spec.js
+++ b/src/components/Buttons/__tests__/CircleButton.spec.js
@@ -1,6 +1,5 @@
import React from 'react'
import renderer from 'react-test-renderer'
-import { StyleRoot } from 'radium'
import { mount } from 'enzyme'
import { spy } from 'sinon'
import Icon from '../../Icon/Icon'
@@ -9,11 +8,9 @@ import CircleButton from '../CircleButton'
it('renders basic CircleButton correctly', () => {
const tree = renderer
.create(
-
-
- 1
-
-
+
+ 1
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -22,13 +19,11 @@ it('renders basic CircleButton correctly', () => {
it('renders CircleButton with Icon correctly', () => {
const tree = renderer
.create(
-
-
-
-
-
-
-
+
+
+
+
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -37,19 +32,17 @@ it('renders CircleButton with Icon correctly', () => {
it('renders CircleButton with passed style prop correctly', () => {
const tree = renderer
.create(
-
-
-
- 1
-
-
-
+
+
+ 1
+
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -58,11 +51,9 @@ it('renders CircleButton with passed style prop correctly', () => {
it('renders CircleButton with passed ariaLabel correctly', () => {
const tree = renderer
.create(
-
-
- 1
-
-
+
+ 1
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -71,11 +62,9 @@ it('renders CircleButton with passed ariaLabel correctly', () => {
it('renders CircleButton with passed disabled prop correctly', () => {
const tree = renderer
.create(
-
-
- 1
-
-
+
+ 1
+
)
.toJSON()
expect(tree).toMatchSnapshot()
@@ -84,11 +73,9 @@ it('renders CircleButton with passed disabled prop correctly', () => {
it('calls onClick callback correctly', () => {
const onClick = spy()
const CButton = mount(
-
-
- 1
-
-
+
+ 1
+
)
const button = CButton.find('button').first()
@@ -99,13 +86,11 @@ it('calls onClick callback correctly', () => {
it('does not call onClick when disabled prop is true', () => {
const onClick = spy()
const CButton = mount(
-
-
-
- 1
-
-
-
+
+
+ 1
+
+
)
const button = CButton.find('button').first()
diff --git a/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap b/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap
index 45e80ad3..7fb9652f 100644
--- a/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap
+++ b/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap
@@ -1,979 +1,1048 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Button applies the elementAttributes prop correctly 1`] = `
-
-
-
-
+ Hi
+
`;
exports[`Button can render as a link if an href is provided 1`] = `
-
+ Hi
+
`;
exports[`Button renders all sizes correctly 1`] = `
-
-
-
-
+ Primary Button
+
`;
exports[`Button renders all sizes correctly 2`] = `
-
-
-
-
+ Primary Button
+
`;
exports[`Button renders all sizes correctly 3`] = `
-
-
-
-
+ Primary Button
+
`;
exports[`Button renders all sizes correctly 4`] = `
-
-
-
-
+ Primary Button
+
`;
exports[`Button renders all snacks button variants correctly 1`] = `
-
-
-
-
+ Hi
+
`;
exports[`Button renders all snacks button variants correctly 2`] = `
-
-
-
-
+ Hi
+
`;
exports[`Button renders all snacks button variants correctly 3`] = `
-
-
-
-
+ Hi
+
`;
exports[`Button renders all snacks button variants correctly 4`] = `
-
-
-
-
+ Hi
+
`;
exports[`Button renders correctly when disabled 1`] = `
-
-
-
-
+ Hi
+
`;
exports[`Button renders icons correctly 1`] = `
-
-
-