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

Update all dependencies 🌴 #1418

Merged
merged 6 commits into from
Apr 3, 2017
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
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"complexity": [1, 10],
"consistent-return": 0,
"no-confusing-arrow": 0,
"jsx-a11y/accessible-emoji": 1,
"jsx-a11y/anchor-has-content": 1,
"jsx-a11y/aria-activedescendant-has-tabindex": 1,
"jsx-a11y/aria-props": 1,
"jsx-a11y/aria-proptypes": 1,
"jsx-a11y/aria-role": 1,
Expand All @@ -20,14 +22,17 @@
"jsx-a11y/heading-has-content": 1,
"jsx-a11y/href-no-hash": 1,
"jsx-a11y/html-has-lang": 1,
"jsx-a11y/iframe-has-title": 1,
"jsx-a11y/img-has-alt": 1,
"jsx-a11y/img-redundant-alt": 1,
"jsx-a11y/label-has-for": 1,
"jsx-a11y/lang": 1,
"jsx-a11y/mouse-events-have-key-events": 1,
"jsx-a11y/no-access-key": 1,
"jsx-a11y/no-marquee": 1,
"jsx-a11y/no-autofocus": 1,
"jsx-a11y/no-distracting-elements": 1,
"jsx-a11y/no-onchange": 1,
"jsx-a11y/no-redundant-roles": 1,
"jsx-a11y/no-static-element-interactions": 1,
"jsx-a11y/onclick-has-focus": 1,
"jsx-a11y/onclick-has-role": 1,
Expand Down
7 changes: 6 additions & 1 deletion docs/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"__PROD__": false
},
"rules": {
"jsx-a11y/accessible-emoji": 0,
"jsx-a11y/anchor-has-content": 0,
"jsx-a11y/aria-activedescendant-has-tabindex": 0,
"jsx-a11y/aria-props": 0,
"jsx-a11y/aria-proptypes": 0,
"jsx-a11y/aria-role": 0,
Expand All @@ -16,14 +18,17 @@
"jsx-a11y/heading-has-content": 0,
"jsx-a11y/href-no-hash": 0,
"jsx-a11y/html-has-lang": 0,
"jsx-a11y/iframe-has-title": 0,
"jsx-a11y/img-has-alt": 0,
"jsx-a11y/img-redundant-alt": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/lang": 0,
"jsx-a11y/mouse-events-have-key-events": 0,
"jsx-a11y/no-access-key": 0,
"jsx-a11y/no-marquee": 0,
"jsx-a11y/no-autofocus": 0,
"jsx-a11y/no-distracting-elements": 0,
"jsx-a11y/no-onchange": 0,
"jsx-a11y/no-redundant-roles": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/onclick-has-focus": 0,
"jsx-a11y/onclick-has-role": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class MenuExampleStackable extends Component {
return (
<Menu stackable>
<Menu.Item>
<img src='/assets/images/logo.png' />
<img src='/logo.png' />
</Menu.Item>

<Menu.Item
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@
"lodash": "^4.17.2"
},
"devDependencies": {
"@types/react": "^0.14.54",
"@types/react": "^15.0.14",
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.0.0",
"babel-loader": "^6.2.8",
"babel-plugin-__coverage__": "^11.0.0",
"babel-plugin-lodash": "^3.2.10",
"babel-plugin-react-transform": "^2.0.2",
"babel-plugin-transform-react-remove-prop-types": "^0.3.2",
"babel-plugin-transform-react-handled-props": "^0.2.3",
"babel-plugin-transform-react-remove-prop-types": "^0.2.10",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.5.0",
Expand All @@ -85,9 +85,9 @@
"empty": "^0.10.1",
"enzyme": "^2.7.1",
"eslint-config-ta": "^5.2.0",
"eslint-plugin-jsx-a11y": "^3.0.1",
"eslint-plugin-jsx-a11y": "^4.0.0",
"express": "^4.13.4",
"faker": "^3.0.1",
"faker": "^4.1.0",
"gh-pages": "^0.12.0",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-html-replace": "^1.6.2",
Expand Down
3 changes: 2 additions & 1 deletion src/modules/Embed/Embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default class Embed extends Component {
}

renderEmbed() {
const { children } = this.props
const { children, source } = this.props
const { active } = this.state

if (!active) return null
Expand All @@ -186,6 +186,7 @@ export default class Embed extends Component {
return (
<div className='embed'>
<iframe
title={`Embedded content from ${source}.`}
allowFullScreen=''
frameBorder='0'
height='100%'
Expand Down
53 changes: 29 additions & 24 deletions test/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,35 @@
"mount": false
},
"rules": {
"jsx-a11y/anchor-has-content": 0,
"jsx-a11y/aria-props": 0,
"jsx-a11y/aria-proptypes": 0,
"jsx-a11y/aria-role": 0,
"jsx-a11y/aria-unsupported-elements": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/heading-has-content": 0,
"jsx-a11y/href-no-hash": 0,
"jsx-a11y/html-has-lang": 0,
"jsx-a11y/img-has-alt": 0,
"jsx-a11y/img-redundant-alt": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/lang": 0,
"jsx-a11y/mouse-events-have-key-events": 0,
"jsx-a11y/no-access-key": 0,
"jsx-a11y/no-marquee": 0,
"jsx-a11y/no-onchange": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/onclick-has-focus": 0,
"jsx-a11y/onclick-has-role": 0,
"jsx-a11y/role-has-required-aria-props": 0,
"jsx-a11y/role-supports-aria-props": 0,
"jsx-a11y/scope": 0,
"jsx-a11y/tabindex-no-positive": 0,
"jsx-a11y/accessible-emoji": 1,
"jsx-a11y/anchor-has-content": 1,
"jsx-a11y/aria-activedescendant-has-tabindex": 1,
"jsx-a11y/aria-props": 1,
"jsx-a11y/aria-proptypes": 1,
"jsx-a11y/aria-role": 1,
"jsx-a11y/aria-unsupported-elements": 1,
"jsx-a11y/click-events-have-key-events": 1,
"jsx-a11y/heading-has-content": 1,
"jsx-a11y/href-no-hash": 1,
"jsx-a11y/html-has-lang": 1,
"jsx-a11y/iframe-has-title": 1,
"jsx-a11y/img-has-alt": 1,
"jsx-a11y/img-redundant-alt": 1,
"jsx-a11y/label-has-for": 1,
"jsx-a11y/lang": 1,
"jsx-a11y/mouse-events-have-key-events": 1,
"jsx-a11y/no-access-key": 1,
"jsx-a11y/no-autofocus": 1,
"jsx-a11y/no-distracting-elements": 1,
"jsx-a11y/no-onchange": 1,
"jsx-a11y/no-redundant-roles": 1,
"jsx-a11y/no-static-element-interactions": 1,
"jsx-a11y/onclick-has-focus": 1,
"jsx-a11y/onclick-has-role": 1,
"jsx-a11y/role-has-required-aria-props": 1,
"jsx-a11y/role-supports-aria-props": 1,
"jsx-a11y/scope": 1,
"jsx-a11y/tabindex-no-positive": 1,
"react/jsx-curly-spacing": 0
}
}
40 changes: 24 additions & 16 deletions test/specs/modules/Embed/Embed-test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import faker from 'faker'
import React from 'react'

import Embed from 'src/modules/Embed/Embed'
import * as common from 'test/specs/commonTests'

const assertIframeSrc = (props, srcPart) => {
const {
id = faker.random.word(),
id = 'default-test-id',
source = 'youtube',
...rest,
} = props

shallow(<Embed active id={id} source={source} {...rest} />)
.find('iframe')
.should.have.attr('src')
.contain(srcPart)
.which.contains(srcPart)
}

describe('Embed', () => {
Expand Down Expand Up @@ -42,7 +41,7 @@ describe('Embed', () => {
})

it('renders nothing when false', () => {
const children = faker.hacker.phrase()
const children = 'child text'

shallow(<Embed>{children}</Embed>)
.should.not.contain(<div className='embed'>{children}</div>)
Expand All @@ -65,17 +64,18 @@ describe('Embed', () => {

describe('color', () => {
it('generates url part for source', () => {
const color = faker.internet.color()
const color = 'red'
assertIframeSrc({ color }, `&amp;color=${encodeURIComponent(color)}`)
})
})

describe('defaultActive', () => {
it('sets the initial active state', () => {
const value = faker.random.boolean()
shallow(<Embed defaultActive />)
.should.have.state('active', true)

shallow(<Embed defaultActive={value} />)
.should.have.state('active', value)
shallow(<Embed defaultActive={false} />)
.should.have.state('active', false)
})
})

Expand All @@ -94,7 +94,7 @@ describe('Embed', () => {
})

it('renders img when defined', () => {
const url = faker.image.imageUrl()
const url = 'foo.png'

shallow(<Embed placeholder={url} />)
.should.contain(<img className='placeholder' src={url} />)
Expand Down Expand Up @@ -124,24 +124,32 @@ describe('Embed', () => {

describe('source', () => {
it('generates url for YouTube', () => {
const id = faker.random.word()
const id = 'foo'

assertIframeSrc({ id }, `//www.youtube.com/embed/${id}`)
})

it('generates url for Vimeo', () => {
const id = faker.random.word()
const id = 'foo'

assertIframeSrc({ source: 'vimeo', id }, `//player.vimeo.com/video/${id}`)
})

it('sets the iframe title', () => {
const sources = ['youtube', 'vimeo']

assertIframeSrc(
{ source: 'vimeo', id },
`//player.vimeo.com/video/${id}`
)
sources.forEach(source => {
shallow(<Embed active id='foo' source={source} />)
.find('iframe')
.should.have.attr('title')
.which.equals(`Embedded content from ${source}.`)
})
})
})

describe('url', () => {
it('passes url to iframe', () => {
const url = faker.internet.url()
const url = 'https://google.com'

shallow(<Embed active url={url} />)
.find('iframe')
Expand Down