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

chore(package): update deps #3131

Merged
merged 2 commits into from
Sep 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@
},
"homepage": "/~https://github.com/Semantic-Org/Semantic-UI-React#readme",
"dependencies": {
"@babel/runtime": "^7.0.0-rc.1",
"classnames": "^2.2.5",
"keyboard-key": "^1.0.1",
"@babel/runtime": "^7.0.0",
"classnames": "^2.2.6",
"keyboard-key": "^1.0.2",
"lodash": "^4.17.10",
"prop-types": "^15.6.1",
"shallowequal": "^1.0.2"
"prop-types": "^15.6.2",
"shallowequal": "^1.1.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
Expand All @@ -87,7 +87,7 @@
"@babel/register": "^7.0.0",
"@babel/standalone": "^7.0.0",
"@types/react": "^16.0.18",
"anchor-js": "^4.1.0",
"anchor-js": "^4.1.1",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.2",
"babel-plugin-filter-imports": "^2.0.0",
Expand All @@ -99,13 +99,13 @@
"chai": "^4.1.2",
"chai-enzyme": "^1.0.0-beta.1",
"copy-to-clipboard": "^3.0.8",
"cross-env": "^5.1.4",
"debug": "^3.0.1",
"cross-env": "^5.2.0",
"debug": "^3.1.0",
"dirty-chai": "^2.0.1",
"doctoc": "^1.3.0",
"doctrine": "^2.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"doctoc": "^1.3.1",
"doctrine": "^2.1.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.4.0",
"eslint": "^4.4.1",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.7.0",
Expand All @@ -119,24 +119,24 @@
"gulp-util": "^3.0.8",
"husky": "^0.14.3",
"imports-loader": "^0.7.1",
"karma": "^2.0.4",
"karma": "^3.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-coverage": "^1.1.2",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack-with-fast-source-maps": "^1.10.2",
"leven": "^2.1.0",
"lint-staged": "^7.2.0",
"lint-staged": "^7.2.2",
"mocha": "^5.2.0",
"prettier": "^1.12.0",
"puppeteer": "1.3.0",
"prettier": "^1.14.2",
"puppeteer": "^1.7.0",
"raw-loader": "^0.5.1",
"react": "^16.4.2",
"react-ace": "^6.1.4",
"react-docgen": "^2.17.0",
"react-docgen": "^2.21.0",
"react-dom": "^16.4.2",
"react-hot-loader": "^4.3.4",
"react-hot-loader": "^4.3.6",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-source-render": "^1.1.3",
Expand All @@ -148,14 +148,14 @@
"satisfied": "^1.1.2",
"semantic-ui-css": "^2.3.3",
"simulant": "^0.2.2",
"sinon": "^6.1.4",
"sinon": "^6.2.0",
"sinon-chai": "^3.2.0",
"ta-scripts": "^2.5.2",
"through2": "^2.0.3",
"tslint": "^5.10.0",
"tslint-config-airbnb": "^5.9.2",
"tslint": "^5.11.0",
"tslint-config-airbnb": "^5.11.0",
"typescript": "^2.9.2",
"vinyl": "^2.1.0",
"vinyl": "^2.2.0",
"webpack": "^3.6.0",
"webpack-dev-middleware": "^1.12.0"
},
Expand Down
1 change: 1 addition & 0 deletions static.webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default (webpackConfig, { stage }) => ({
'anchor-js': 'AnchorJS',
'@babel/standalone': 'Babel',
faker: 'faker',
'prettier/standalone': 'prettier',
'prop-types': 'PropTypes',
react: 'React',
'react-dom': 'ReactDOM',
Expand Down
2 changes: 2 additions & 0 deletions test/specs/addons/Confirm/Confirm-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ describe('Confirm', () => {
common.isConformant(Confirm)

common.implementsShorthandProp(Confirm, {
autoGenerateKey: false,
propKey: 'header',
ShorthandComponent: Modal.Header,
mapValueToProps: content => ({ content }),
})
common.implementsShorthandProp(Confirm, {
autoGenerateKey: false,
propKey: 'content',
ShorthandComponent: Modal.Content,
mapValueToProps: content => ({ content }),
Expand Down
7 changes: 6 additions & 1 deletion test/specs/addons/Portal/Portal-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ const wrapperMount = (node, opts) => {

describe('Portal', () => {
afterEach(() => {
if (wrapper && wrapper.unmount) wrapper.unmount()
if (wrapper && wrapper.unmount) {
try {
wrapper.unmount()
// eslint-disable-next-line no-empty
} catch (e) {}
}
})

common.hasSubcomponents(Portal, [PortalInner])
Expand Down
7 changes: 6 additions & 1 deletion test/specs/behaviors/Visibility/Visibility-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ describe('Visibility', () => {
})

afterEach(() => {
if (wrapper && wrapper.unmount) wrapper.unmount()
if (wrapper && wrapper.unmount) {
try {
wrapper.unmount()
// eslint-disable-next-line no-empty
} catch (e) {}
}
})

describe('calculations', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/specs/collections/Breadcrumb/BreadcrumbDivider-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ describe('BreadcrumbDivider', () => {
common.rendersChildren(BreadcrumbDivider)

common.implementsIconProp(BreadcrumbDivider, {
autoGenerateKey: false,
shorthandDefaultProps: {
className: 'divider',
},
})

it('renders as a div by default', () => {
shallow(<BreadcrumbDivider />)
.should.have.tagName('div')
shallow(<BreadcrumbDivider />).should.have.tagName('div')
})
})
13 changes: 6 additions & 7 deletions test/specs/collections/Form/FormField-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('FormField', () => {
common.isConformant(FormField)
common.rendersChildren(FormField)

common.implementsHTMLLabelProp(FormField)
common.implementsHTMLLabelProp(FormField, { autoGenerateKey: false })
common.implementsWidthProp(FormField, SUI.WIDTHS, {
canEqual: false,
propKey: 'width',
Expand All @@ -30,26 +30,25 @@ describe('FormField', () => {
const controls = ['button', 'input', 'select', 'textarea']

controls.forEach((control) => {
shallow(<FormField control={control} />)
.should.have.descendants(control)
shallow(<FormField control={control} />).should.have.descendants(control)
})
})
})

describe('label', () => {
it('wraps html checkbox inputs', () => {
const text = faker.hacker.phrase()
const label = shallow(<FormField control='input' label={text} type='checkbox' />)
.find('label')
const label = shallow(<FormField control='input' label={text} type='checkbox' />).find(
'label',
)

label.childAt(0).should.have.tagName('input')
label.should.contain.text(text)
})

it('wraps html radio inputs', () => {
const text = faker.hacker.phrase()
const label = shallow(<FormField control='input' label={text} type='radio' />)
.find('label')
const label = shallow(<FormField control='input' label={text} type='radio' />).find('label')

label.childAt(0).should.have.tagName('input')
label.should.contain.text(text)
Expand Down
26 changes: 9 additions & 17 deletions test/specs/collections/Menu/MenuItem-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('MenuItem', () => {
common.rendersChildren(MenuItem)

common.implementsCreateMethod(MenuItem)
common.implementsIconProp(MenuItem)
common.implementsIconProp(MenuItem, { autoGenerateKey: false })

common.propKeyOnlyToClassName(MenuItem, 'active')
common.propKeyOnlyToClassName(MenuItem, 'disabled')
Expand All @@ -24,29 +24,24 @@ describe('MenuItem', () => {
common.propValueOnlyToClassName(MenuItem, 'position', ['left', 'right'])

it('renders a `div` by default', () => {
shallow(<MenuItem />)
.should.have.tagName('div')
shallow(<MenuItem />).should.have.tagName('div')
})

describe('name', () => {
it('uses the name prop as Start Cased child text', () => {
shallow(<MenuItem name='upcomingEvents' />)
.should.contain.text('Upcoming Events')
shallow(<MenuItem name='upcomingEvents' />).should.contain.text('Upcoming Events')
})
})

describe('icon', () => {
it('does not add `icon` className if there is also `name`', () => {
shallow(<MenuItem icon='user' name='users' />)
.should.not.have.className('icon')
shallow(<MenuItem icon='user' name='users' />).should.not.have.className('icon')
})
it('does not add `icon` className if there is also `content`', () => {
shallow(<MenuItem icon='user' content='Users' />)
.should.not.have.className('icon')
shallow(<MenuItem icon='user' content='Users' />).should.not.have.className('icon')
})
it('adds `icon` className if there is an `icon` without `name` or `content`', () => {
shallow(<MenuItem icon='user' />)
.should.have.className('icon')
shallow(<MenuItem icon='user' />).should.have.className('icon')
})
})

Expand All @@ -56,8 +51,7 @@ describe('MenuItem', () => {
const event = { target: null }
const props = { name: 'home', index: 0 }

shallow(<MenuItem onClick={onClick} {...props} />)
.simulate('click', event)
shallow(<MenuItem onClick={onClick} {...props} />).simulate('click', event)

onClick.should.have.been.calledOnce()
onClick.should.have.been.calledWithMatch(event, props)
Expand All @@ -66,14 +60,12 @@ describe('MenuItem', () => {
it('is not called when is disabled', () => {
const onClick = sandbox.spy()

shallow(<MenuItem disabled onClick={onClick} />)
.simulate('click')
shallow(<MenuItem disabled onClick={onClick} />).simulate('click')
onClick.should.have.callCount(0)
})

it('renders an `a` tag', () => {
shallow(<MenuItem onClick={() => null} />)
.should.have.tagName('a')
shallow(<MenuItem onClick={() => null} />).should.have.tagName('a')
})
})
})
5 changes: 4 additions & 1 deletion test/specs/collections/Message/Message-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ describe('Message', () => {
rendersContent: false,
})

common.implementsIconProp(Message)
common.implementsIconProp(Message, { autoGenerateKey: false })
common.implementsShorthandProp(Message, {
autoGenerateKey: false,
propKey: 'content',
ShorthandComponent: 'p',
mapValueToProps: val => ({ children: val }),
})
common.implementsShorthandProp(Message, {
autoGenerateKey: false,
propKey: 'header',
ShorthandComponent: MessageHeader,
mapValueToProps: val => ({ content: val }),
})
common.implementsShorthandProp(Message, {
autoGenerateKey: false,
propKey: 'list',
ShorthandComponent: MessageList,
mapValueToProps: val => ({ items: val }),
Expand Down
7 changes: 7 additions & 0 deletions test/specs/commonTests/implementsCommonProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ export const implementsHTMLLabelProp = (Component, options = {}) => {
*
* @param {function} Component The component to test.
* @param {object} [options={}]
* @param {boolean} [options.alwaysPresent] Whether or not the shorthand exists by default.
* @param {boolean} [options.autoGenerateKey=false] Whether or not automatic key generation is
* allowed for the shorthand component.
* @param {string} [options.propKey='icon'] The name of the shorthand prop.
* @param {string|function} [options.ShorthandComponent] The component that should be rendered from the shorthand value.
* @param {function} [options.mapValueToProps] A function that maps a primitive value to the Component props
Expand All @@ -119,6 +122,8 @@ export const implementsIconProp = (Component, options = {}) => {
*
* @param {function} Component The component to test.
* @param {object} [options={}]
* @param {boolean} [options.autoGenerateKey=false] Whether or not automatic key generation is
* allowed for the shorthand component.
* @param {string} [options.propKey='image'] The name of the shorthand prop.
* @param {string|function} [options.ShorthandComponent] The component that should be rendered from the shorthand value.
* @param {function} [options.mapValueToProps] A function that maps a primitive value to the Component props
Expand All @@ -140,6 +145,8 @@ export const implementsImageProp = (Component, options = {}) => {
*
* @param {function} Component The component to test.
* @param {object} [options={}]
* @param {boolean} [options.autoGenerateKey=false] Whether or not automatic key generation is
* allowed for the shorthand component.
* @param {string} [options.propKey='label'] The name of the shorthand prop.
* @param {string|function} [options.ShorthandComponent] The component that should be rendered from the shorthand value.
* @param {function} [options.mapValueToProps] A function that maps a primitive value to the Component props
Expand Down
14 changes: 10 additions & 4 deletions test/specs/commonTests/implementsShorthandProp.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const shorthandComponentName = (ShorthandComponent) => {
* @param {boolean} [options.autoGenerateKey=false] Whether or not automatic key generation is
* allowed for the shorthand component.
* @param {function} options.mapValueToProps A function that maps a primitive value to the Component props.
* @param {Boolean} [options.parentIsFragment=false] A flag that shows the type of the Component to test.
* @param {Object} [options.requiredProps={}] Props required to render the component.
* @param {Object} [options.shorthandDefaultProps] Default props for the shorthand component.
* @param {Object} [options.shorthandOverrideProps] Override props for the shorthand component.
Expand All @@ -36,8 +37,9 @@ export default (Component, options = {}) => {
const {
alwaysPresent,
assertExactMatch = true,
autoGenerateKey = false,
autoGenerateKey = true,
mapValueToProps,
parentIsFragment = false,
propKey,
ShorthandComponent,
shorthandDefaultProps = {},
Expand Down Expand Up @@ -68,16 +70,20 @@ export default (Component, options = {}) => {
// Enzyme's .key() method is not consistent with React for elements with
// no key (`undefined` vs `null`), so use the underlying element instead
// Will fail if more than one element of this type is found
const shorthandElement = wrapper.find(ShorthandComponent).getElement()
expect(shorthandElement.key).to.equal(expectedShorthandElement.key, "key doesn't match")
if (autoGenerateKey) {
const shorthandElement = wrapper.find(ShorthandComponent).getElement()
expect(shorthandElement.key).to.equal(expectedShorthandElement.key, "key doesn't match")
}
}

if (alwaysPresent || (Component.defaultProps && Component.defaultProps[propKey])) {
it(`has default ${name} when not defined`, () => {
shallow(<Component {...requiredProps} />).should.have.descendants(name)
})
} else {
noDefaultClassNameFromProp(Component, propKey, [], options)
if (!parentIsFragment) {
noDefaultClassNameFromProp(Component, propKey, [], options)
}

it(`has no ${name} when not defined`, () => {
shallow(<Component {...requiredProps} />).should.not.have.descendants(name)
Expand Down
3 changes: 2 additions & 1 deletion test/specs/elements/Button/Button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ describe('Button', () => {
common.rendersChildren(Button)

common.implementsCreateMethod(Button)
common.implementsIconProp(Button)
common.implementsIconProp(Button, { autoGenerateKey: false })
common.implementsLabelProp(Button, {
autoGenerateKey: false,
shorthandDefaultProps: {
basic: true,
pointing: 'left',
Expand Down
5 changes: 3 additions & 2 deletions test/specs/elements/Header/Header-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ describe('Header', () => {
common.hasSubcomponents(Header, [HeaderContent, HeaderSubheader])
common.rendersChildren(Header)

common.implementsIconProp(Header)
common.implementsImageProp(Header)
common.implementsIconProp(Header, { autoGenerateKey: false })
common.implementsImageProp(Header, { autoGenerateKey: false })
common.implementsShorthandProp(Header, {
autoGenerateKey: false,
propKey: 'subheader',
ShorthandComponent: HeaderSubheader,
mapValueToProps: val => ({ content: val }),
Expand Down
Loading