diff options
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>) => { |
