Skip to content

Commit

Permalink
upgrade jest related dependencies and fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
schnogz committed Jun 8, 2018
1 parent 0343463 commit 66a5cf0
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 51 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@
"file-loader": "^1.1.5",
"html-webpack-plugin": "^3.0.7",
"identity-obj-proxy": "^3.0.0",
"istanbul": "^0.4.4",
"istanbul": "^0.4.5",
"istanbul-coveralls": "^1.0.3",
"jest": "^22.4.2",
"jest-cli": "^22.4.2",
"jest": "^23.1.0",
"jest-cli": "^23.1.0",
"jest-css-modules": "^1.1.0",
"jest-fetch-mock": "^1.5.0",
"jest-styled-components": "^5.0.0",
"lerna": "^2.9.0",
"jest-fetch-mock": "^1.6.3",
"jest-styled-components": "^5.0.1",
"lerna": "^2.11.0",
"mock-socket": "^7.1.0",
"npm-watch": "^0.3.0",
"react-hot-loader": "^4.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ import { convertFiatToCoin, convertCoinToFiat } from './services'
import Convertor from './template'

class ConvertorContainer extends React.PureComponent {
static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.value, prevState)) {
return nextProps.value
}
return null
}

constructor (props) {
super(props)
this.state = { coin: '', fiat: '' }
Expand All @@ -22,6 +15,13 @@ class ConvertorContainer extends React.PureComponent {
this.handleFocus = this.handleFocus.bind(this)
}

static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.value, prevState)) {
return nextProps.value
}
return null
}

handleCoinChange (e) {
const { unit, currency, btcRates, bchRates, ethRates } = this.props
const nextProps = convertCoinToFiat(e.target.value, unit, currency, bchRates, btcRates, ethRates)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ const getErrorState = (meta) => {
}

class NumberBoxDebounced extends React.Component {
static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.input.value, prevState)) {
return { value: nextProps.input.value }
}
return null
}

constructor (props) {
super(props)
this.state = { value: props.input.value }
Expand All @@ -41,6 +34,13 @@ class NumberBoxDebounced extends React.Component {
this.handleFocus = this.handleFocus.bind(this)
}

static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.input.value, prevState)) {
return { value: nextProps.input.value }
}
return null
}

componentWillUnmount () {
clearTimeout(this.timeout)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ const getErrorState = (meta) => {
}

class TextAreaDebounced extends React.Component {
static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.input.value, prevState)) {
return { value: nextProps.input.value }
}
return null
}

constructor (props) {
super(props)
this.state = { value: props.input.value }
Expand All @@ -40,6 +33,13 @@ class TextAreaDebounced extends React.Component {
this.handleFocus = this.handleFocus.bind(this)
}

static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.input.value, prevState)) {
return { value: nextProps.input.value }
}
return null
}

componentWillUnmount () {
clearTimeout(this.timeout)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ const getErrorState = (meta) => {
}

class TextBoxDebounced extends React.Component {
static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.input.value, prevState)) {
return { value: nextProps.input.value }
}
return null
}

constructor (props) {
super(props)
this.state = { value: props.input.value }
Expand All @@ -41,6 +34,13 @@ class TextBoxDebounced extends React.Component {
this.handleFocus = this.handleFocus.bind(this)
}

static getDerivedStateFromProps (nextProps, prevState) {
if (!equals(nextProps.input.value, prevState)) {
return { value: nextProps.input.value }
}
return null
}

componentWillUnmount () {
clearTimeout(this.timeout)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ const Eth = styled.div`
`

class BuySellAnimation extends React.PureComponent {
constructor (props) {
super(props)
this.state = {
base: false,
btc: '',
bch: '',
eth: ''
}
}

static getDerivedStateFromProps (nextProps) {
const sfoxCountries = nextProps.options.platforms.web.sfox.countries
const unocoinCountries = nextProps.options.platforms.web.unocoin.countries
Expand Down Expand Up @@ -101,16 +111,6 @@ class BuySellAnimation extends React.PureComponent {
}
}

constructor (props) {
super(props)
this.state = {
base: false,
btc: '',
bch: '',
eth: ''
}
}

componentDidMount () {
setTimeout(() => this.setState({ base: true }), 1)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ import Success from './template.success'
import { formValueSelector } from 'redux-form'

class TwoStepVerificationContainer extends React.PureComponent {
static getDerivedStateFromProps (nextProps, prevState) {
const data = nextProps.data.data
if (data.authType === 4) return { authName: 'Authenticator App' }
if (data.authType === 5) return { authName: 'SMS Codes' }
if (data.authType === 1 || data.authType === 2) return { authName: 'Yubikey' }
return prevState
}
constructor (props) {
super(props)

Expand All @@ -30,6 +23,14 @@ class TwoStepVerificationContainer extends React.PureComponent {
this.state = { authName: '', pulse: false }
}

static getDerivedStateFromProps (nextProps, prevState) {
const data = nextProps.data.data
if (data.authType === 4) return { authName: 'Authenticator App' }
if (data.authType === 5) return { authName: 'SMS Codes' }
if (data.authType === 1 || data.authType === 2) return { authName: 'Yubikey' }
return prevState
}

componentDidUpdate (prevProps) {
if (this.props.data.data.authType > 0 && prevProps.data.data.authType === 0) this.props.updateUI({ editing: true })
}
Expand Down

0 comments on commit 66a5cf0

Please sign in to comment.