diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-06-23 16:56:02 +0300 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-06-23 16:56:02 +0300 |
| commit | 1c2cfddfb487770bcc19f11eedd490c3bebe175d (patch) | |
| tree | c82d209e8e11d3c0a2d7338dbaa2db266d59b917 /test | |
| parent | 79f630bf805caa15d51c276dce70c131bd42162d (diff) | |
| download | mullvadvpn-1c2cfddfb487770bcc19f11eedd490c3bebe175d.tar.xz mullvadvpn-1c2cfddfb487770bcc19f11eedd490c3bebe175d.zip | |
Migrate to React 15.6
Diffstat (limited to 'test')
| -rw-r--r-- | test/components/AccountInput.spec.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/components/AccountInput.spec.js b/test/components/AccountInput.spec.js index 180598d49e..0a6e15b12e 100644 --- a/test/components/AccountInput.spec.js +++ b/test/components/AccountInput.spec.js @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { KeyType, createKeyEvent } from '../mocks/dom'; import React from 'react'; -import ReactTestUtils, { Simulate } from 'react-addons-test-utils'; +import ReactTestUtils, { Simulate } from 'react-dom/test-utils'; import AccountInput from '../../app/components/AccountInput'; describe('components/AccountInput', () => { @@ -28,7 +28,7 @@ describe('components/AccountInput', () => { const component = ReactTestUtils.renderIntoDocument( <AccountInput onChange={ onChange } /> ); - + Simulate.keyDown(component._ref, createKeyEvent(KeyType._1)); }); @@ -120,7 +120,7 @@ describe('components/AccountInput', () => { const component = ReactTestUtils.renderIntoDocument( <AccountInput value="0000" /> ); - + component.setState({ selectionRange: [1, 3] }, () => { Simulate.keyDown(component._ref, createKeyEvent(KeyType._1)); @@ -140,7 +140,7 @@ describe('components/AccountInput', () => { for(let i = 0; i < 12; i++) { Simulate.keyDown(component._ref, createKeyEvent(KeyType._1)); } - + component.setState({}, () => { expect(component.state.value).to.be.equal('111111111111'); expect(component.state.selectionRange).to.deep.equal([12, 12]); @@ -152,10 +152,10 @@ describe('components/AccountInput', () => { const component = ReactTestUtils.renderIntoDocument( <AccountInput value="0000" /> ); - + component.setState({ selectionRange: [1, 1]}, () => { Simulate.keyDown(component._ref, createKeyEvent(KeyType._1)); - + component.setState({}, () => { expect(component.state.value).to.be.equal('01000'); expect(component.state.selectionRange).to.deep.equal([2, 2]); @@ -168,7 +168,7 @@ describe('components/AccountInput', () => { const component = ReactTestUtils.renderIntoDocument( <AccountInput value="0000" /> ); - + component.setState({ selectionRange: [0, 0] }, () => { Simulate.keyDown(component._ref, createKeyEvent(KeyType.Backspace)); |
