diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-02-21 10:45:11 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-02-21 10:45:11 +0100 |
| commit | de737c54c413f96c35b4e9bc6280fc7d26e4fa83 (patch) | |
| tree | 0cf470c59b4c7c8a6327e64610f68f5facd78d6d /test/components/AccountInput.spec.js | |
| parent | ae9c255b3ecdec341090c932db6cb261147a7382 (diff) | |
| parent | 1214138633bcca19a1b96622400f3fbcf4044bd9 (diff) | |
| download | mullvadvpn-de737c54c413f96c35b4e9bc6280fc7d26e4fa83.tar.xz mullvadvpn-de737c54c413f96c35b4e9bc6280fc7d26e4fa83.zip | |
Merge branch 'update-flow'
Diffstat (limited to 'test/components/AccountInput.spec.js')
| -rw-r--r-- | test/components/AccountInput.spec.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/components/AccountInput.spec.js b/test/components/AccountInput.spec.js index ee73323950..701a1c243e 100644 --- a/test/components/AccountInput.spec.js +++ b/test/components/AccountInput.spec.js @@ -1,15 +1,19 @@ // @flow import { expect } from 'chai'; import { createKeyEvent } from '../helpers/dom-events'; -import React from 'react'; +import * as React from 'react'; import ReactTestUtils, { Simulate } from 'react-dom/test-utils'; import AccountInput from '../../app/components/AccountInput'; import type { AccountInputProps } from '../../app/components/AccountInput'; describe('components/AccountInput', () => { - const getInputRef = (component: AccountInput): HTMLInputElement => { - return ReactTestUtils.findRenderedDOMComponentWithTag(component, 'input'); + const getInputRef = (component) => { + const node = ReactTestUtils.findRenderedDOMComponentWithTag(component, 'input'); + if(!(node instanceof HTMLInputElement)) { + throw new Error('Node is expected to be an instance of HTMLInputElement'); + } + return node; }; const render = (mergeProps: $Shape<AccountInputProps>) => { |
