React UI: Make test spy attachment more jest-y (#6361)

Signed-off-by: Julius Volz <julius.volz@gmail.com>
pull/6368/head
Julius Volz 6 years ago committed by GitHub
parent d2a3ef2f12
commit cb92a45bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      web/ui/react-app/src/ExpressionInput.test.tsx

@ -177,8 +177,7 @@ describe('ExpressionInput', () => {
it('should blur input on escape', () => {
const downshift = expressionInput.find(Downshift);
const instance: any = expressionInput.instance();
const spyBlur = jest.fn();
instance.exprInputRef.current.blur = spyBlur;
const spyBlur = jest.spyOn(instance.exprInputRef.current, 'blur');
const input = downshift.find(Input);
downshift.setState({ isOpen: false });
const event = getKeyEvent('Escape');

Loading…
Cancel
Save