From cb92a45bf3bd6eda873c2f6491542845f2cbef84 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Sun, 24 Nov 2019 13:14:01 +0100 Subject: [PATCH] React UI: Make test spy attachment more jest-y (#6361) Signed-off-by: Julius Volz --- web/ui/react-app/src/ExpressionInput.test.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/ui/react-app/src/ExpressionInput.test.tsx b/web/ui/react-app/src/ExpressionInput.test.tsx index d9e739d2e..07bb0b01e 100644 --- a/web/ui/react-app/src/ExpressionInput.test.tsx +++ b/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');