From 937c4c184b5c89a7ea5aaa34f878bc0b6d7d268f Mon Sep 17 00:00:00 2001 From: Marco Salazar Date: Mon, 8 Nov 2021 09:35:30 -0500 Subject: [PATCH] fix mismerge???? --- .../src/__tests__/ReactDOMFizzServer-test.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js b/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js index 5acb38df2341a..dd5af3c2ae5cd 100644 --- a/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js @@ -1680,20 +1680,16 @@ describe('ReactDOMFizzServer', () => { function getServerSnapshot() { return 'server'; } - function getClientSnapshot() { return 'client'; } - function subscribe() { return () => {}; } - function Child({text}) { Scheduler.unstable_yieldValue(text); return text; } - function App() { const value = useSyncExternalStore( subscribe, @@ -1706,14 +1702,12 @@ describe('ReactDOMFizzServer', () => { ); } - const loggedErrors = []; await act(async () => { const {pipe} = ReactDOMFizzServer.renderToPipeableStream( , - { onError(x) { loggedErrors.push(x); @@ -1737,40 +1731,32 @@ describe('ReactDOMFizzServer', () => { }); // The selector implementation uses the lazy ref initialization pattern - // @gate supportsNativeUseSyncExternalStore // @gate experimental it('calls getServerSnapshot instead of getSnapshot (with selector and isEqual)', async () => { // Same as previous test, but with a selector that returns a complex object // that is memoized with a custom `isEqual` function. const ref = React.createRef(); - function getServerSnapshot() { return {env: 'server', other: 'unrelated'}; } - function getClientSnapshot() { return {env: 'client', other: 'unrelated'}; } - function selector({env}) { return {env}; } - function isEqual(a, b) { return a.env === b.env; } - function subscribe() { return () => {}; } - function Child({text}) { Scheduler.unstable_yieldValue(text); return text; } - function App() { - const {env} = useSyncExternalStoreWithSelector( + const {env} = useSyncExternalStoreExtra( subscribe, getClientSnapshot, getServerSnapshot, @@ -1783,14 +1769,12 @@ describe('ReactDOMFizzServer', () => { ); } - const loggedErrors = []; await act(async () => { const {pipe} = ReactDOMFizzServer.renderToPipeableStream( , - { onError(x) { loggedErrors.push(x); @@ -1799,7 +1783,6 @@ describe('ReactDOMFizzServer', () => { ); pipe(writable); }); - expect(Scheduler).toHaveYielded(['server']); ReactDOM.hydrateRoot(container, );