diff --git a/src/modules/specHelpers/index.js b/src/modules/specHelpers/index.js
index a550031f..fe48085c 100644
--- a/src/modules/specHelpers/index.js
+++ b/src/modules/specHelpers/index.js
@@ -4,90 +4,73 @@ import React from 'react/addons'
const ReactTestUtils = React.addons.TestUtils
export const assertProps = {
- accessibilityLabel: function (Component) {
- // no label
- let dom = renderToDOM()
- assert.equal(dom.getAttribute('aria-label'), null)
+ accessibilityLabel: function (Component, props) {
// with label
const accessibilityLabel = 'accessibilityLabel'
- dom = renderToDOM()
+ const dom = renderToDOM()
assert.equal(dom.getAttribute('aria-label'), accessibilityLabel)
},
- accessibilityLiveRegion: function (Component) {
- // no live
- let dom = renderToDOM()
- assert.equal(dom.getAttribute('aria-live'), null)
- // with live
+ accessibilityLiveRegion: function (Component, props) {
const accessibilityLiveRegion = 'polite'
- dom = renderToDOM()
+ const dom = renderToDOM()
assert.equal(dom.getAttribute('aria-live'), accessibilityLiveRegion)
},
- accessibilityRole: function (Component) {
- // no role
- let dom = renderToDOM()
- assert.equal(dom.getAttribute('role'), null)
- // with role
+ accessibilityRole: function (Component, props) {
const accessibilityRole = 'main'
- dom = renderToDOM()
+ const dom = renderToDOM()
assert.equal(dom.getAttribute('role'), accessibilityRole)
},
- accessible: function (Component) {
+ accessible: function (Component, props) {
// accessible
- let dom = renderToDOM()
+ let dom = renderToDOM()
assert.equal(dom.getAttribute('aria-hidden'), null)
// not accessible
- dom = renderToDOM()
+ dom = renderToDOM()
assert.equal(dom.getAttribute('aria-hidden'), 'true')
},
- component: function (Component, defaultType) {
- let dom, tagName
- const type = 'a'
- // no type (check default)
- dom = renderToDOM()
- tagName = (dom.tagName).toLowerCase()
- assert.equal(tagName, defaultType)
- // with type
- dom = renderToDOM()
- tagName = (dom.tagName).toLowerCase()
- assert.equal(tagName, type)
+ component: function (Component, props) {
+ const component = 'main'
+ const dom = renderToDOM()
+ const tagName = (dom.tagName).toLowerCase()
+ assert.equal(tagName, component)
},
- style: function (Component) {
+ style: function (Component, props) {
let shallow
// default styles
- shallow = shallowRender()
+ shallow = shallowRender()
assert.deepEqual(
shallow.props.style,
Component.defaultProps.style
)
// filtering of unsupported styles
const styleToFilter = { unsupported: 'unsupported' }
- shallow = shallowRender()
+ shallow = shallowRender()
assert.deepEqual(
shallow.props.style.unsupported,
- null,
+ undefined,
'unsupported "style" properties must not be transferred'
)
// merging of custom styles
const styleToMerge = { margin: '10' }
- shallow = shallowRender()
+ shallow = shallowRender()
assert.deepEqual(
shallow.props.style.margin,
styleToMerge.margin,
)
},
- testID: function (Component) {
+ testID: function (Component, props) {
// no testID
- let dom = renderToDOM()
+ let dom = renderToDOM()
assert.equal(dom.getAttribute('data-testid'), null)
// with testID
const testID = 'Example.testID'
- dom = renderToDOM()
+ dom = renderToDOM()
assert.equal(dom.getAttribute('data-testid'), testID)
}
}