From 22d884b38e089897aab25b43650579d143928fde Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Fri, 22 Nov 2019 16:20:07 +0100 Subject: [PATCH] React UI: Fix tests harder (#6316) * React UI: Fix tests harder Again not sure why this passed last time (?), but now I was getting an error about 'NaN' not being a valid value to assign to the 'height' property of the input element. This changes it so that only the blur() function is actually mocked out on the active input element. Signed-off-by: Julius Volz * Fixup Signed-off-by: Julius Volz --- web/ui/react-app/src/ExpressionInput.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ui/react-app/src/ExpressionInput.test.tsx b/web/ui/react-app/src/ExpressionInput.test.tsx index 44b992676..d9e739d2e 100644 --- a/web/ui/react-app/src/ExpressionInput.test.tsx +++ b/web/ui/react-app/src/ExpressionInput.test.tsx @@ -178,7 +178,7 @@ describe('ExpressionInput', () => { const downshift = expressionInput.find(Downshift); const instance: any = expressionInput.instance(); const spyBlur = jest.fn(); - instance.exprInputRef.current = { blur: spyBlur }; + instance.exprInputRef.current.blur = spyBlur; const input = downshift.find(Input); downshift.setState({ isOpen: false }); const event = getKeyEvent('Escape');