From c10215e6c31593034302f9a8014853023d4a696d Mon Sep 17 00:00:00 2001 From: Marco Salazar Date: Mon, 4 Oct 2021 09:46:21 -0400 Subject: [PATCH] and couple more changes wipe out from rebase/pull o.O --- ...MServerSelectiveHydration-test.internal.js | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js index ec4d4c76f5750..bb04b46df1c40 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js @@ -1057,9 +1057,9 @@ describe('ReactDOMServerSelectiveHydration', () => { if (!ref.current) { return; } - ref.current.addEventListener('click', () => { + ref.current.onclick = () => { Scheduler.unstable_yieldValue('Native Click ' + text); - }); + }; }, [text]); return ( { ); } - const finalHTML = ReactDOMServer.renderToString(); - if (__DEV__) { - expect(console.error).toHaveBeenCalledTimes(2); - expect(console.error.calls.argsFor(0)[0]).toContain( - 'useLayoutEffect does nothing on the server', - ); - expect(console.error.calls.argsFor(1)[0]).toContain( - 'useLayoutEffect does nothing on the server', - ); - } + let finalHTML; + expect(() => { + finalHTML = ReactDOMServer.renderToString(); + }).toErrorDev([ + 'useLayoutEffect does nothing on the server', + 'useLayoutEffect does nothing on the server', + ]); expect(Scheduler).toHaveYielded(['App', 'A', 'B']); @@ -1132,8 +1129,5 @@ describe('ReactDOMServerSelectiveHydration', () => { expect(Scheduler).toFlushAndYield(['A']); document.body.removeChild(container); - if (__DEV__) { - expect(console.error).toHaveBeenCalledTimes(2); - } }); });