From 4428e6e570d4f3659dd4ab7b3d3c3da881e0a05c Mon Sep 17 00:00:00 2001 From: Jack Pope Date: Tue, 12 Mar 2024 15:32:19 -0400 Subject: [PATCH] Remove dupe test --- .../ReactHooksInspectionIntegration-test.js | 162 ------------------ 1 file changed, 162 deletions(-) diff --git a/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js b/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js index ffe0251b1d034..003554fb17620 100644 --- a/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js +++ b/packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js @@ -1179,168 +1179,6 @@ describe('ReactHooksInspectionIntegration', () => { `); }); - it('should update isPending returned from useTransition', async () => { - const IndefiniteSuspender = React.lazy(() => new Promise(() => {})); - let startTransition; - function Foo(props) { - const [show, setShow] = React.useState(false); - const [isPending, _startTransition] = React.useTransition(); - React.useMemo(() => 'hello', []); - React.useMemo(() => 'not used', []); - - // Otherwise we capture the version from the react-debug-tools dispatcher. - if (startTransition === undefined) { - startTransition = () => { - _startTransition(() => { - setShow(true); - }); - }; - } - - return ( - - {isPending ? 'Pending' : null} - {show ? : null} - - ); - } - const renderer = await act(() => { - return ReactTestRenderer.create(, {unstable_isConcurrent: true}); - }); - expect(renderer).toMatchRenderedOutput(null); - let childFiber = renderer.root.findByType(Foo)._currentFiber(); - let tree = ReactDebugTools.inspectHooksOfFiber(childFiber); - expect(normalizeSourceLoc(tree)).toMatchInlineSnapshot(` - [ - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 0, - "isStateEditable": true, - "name": "State", - "subHooks": [], - "value": false, - }, - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 1, - "isStateEditable": false, - "name": "Transition", - "subHooks": [], - "value": false, - }, - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 2, - "isStateEditable": false, - "name": "Memo", - "subHooks": [], - "value": "hello", - }, - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 3, - "isStateEditable": false, - "name": "Memo", - "subHooks": [], - "value": "not used", - }, - ] - `); - - await act(() => { - startTransition(); - }); - - expect(renderer).toMatchRenderedOutput('Pending'); - - childFiber = renderer.root.findByType(Foo)._currentFiber(); - tree = ReactDebugTools.inspectHooksOfFiber(childFiber); - expect(normalizeSourceLoc(tree)).toMatchInlineSnapshot(` - [ - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 0, - "isStateEditable": true, - "name": "State", - "subHooks": [], - "value": false, - }, - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 1, - "isStateEditable": false, - "name": "Transition", - "subHooks": [], - "value": true, - }, - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 2, - "isStateEditable": false, - "name": "Memo", - "subHooks": [], - "value": "hello", - }, - { - "debugInfo": null, - "hookSource": { - "columnNumber": 0, - "fileName": "**", - "functionName": "Foo", - "lineNumber": 0, - }, - "id": 3, - "isStateEditable": false, - "name": "Memo", - "subHooks": [], - "value": "not used", - }, - ] - `); - }); - it('should support useDeferredValue hook', async () => { function Foo(props) { React.useDeferredValue('abc');