diff --git a/packages/react-devtools-shared/src/__tests__/__snapshots__/treeContext-test.js.snap b/packages/react-devtools-shared/src/__tests__/__snapshots__/treeContext-test.js.snap index 33230c69aa6b..0194f6f740af 100644 --- a/packages/react-devtools-shared/src/__tests__/__snapshots__/treeContext-test.js.snap +++ b/packages/react-devtools-shared/src/__tests__/__snapshots__/treeContext-test.js.snap @@ -1091,6 +1091,48 @@ Object { } `; +exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (0) 1`] = ` +Object { + "inspectedElementID": 3, + "numElements": 4, + "ownerFlatTree": null, + "ownerID": null, + "searchIndex": null, + "searchResults": Array [], + "searchText": "", + "selectedElementID": 3, + "selectedElementIndex": 1, +} +`; + +exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (1) 1`] = ` +Object { + "inspectedElementID": 4, + "numElements": 4, + "ownerFlatTree": null, + "ownerID": null, + "searchIndex": null, + "searchResults": Array [], + "searchText": "", + "selectedElementID": 4, + "selectedElementIndex": 2, +} +`; + +exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (2) 1`] = ` +Object { + "inspectedElementID": 5, + "numElements": 4, + "ownerFlatTree": null, + "ownerID": null, + "searchIndex": null, + "searchResults": Array [], + "searchText": "", + "selectedElementID": 5, + "selectedElementIndex": 3, +} +`; + exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (0) 1`] = ` Object { "inspectedElementID": 3, diff --git a/packages/react-devtools-shared/src/__tests__/setupEnv.js b/packages/react-devtools-shared/src/__tests__/setupEnv.js index 2b26da5dc4ac..8b18798e6f7a 100644 --- a/packages/react-devtools-shared/src/__tests__/setupEnv.js +++ b/packages/react-devtools-shared/src/__tests__/setupEnv.js @@ -1,15 +1,5 @@ 'use strict'; -// Import test renderer and then reset modules for two reasons: -// 1. We don't want test renderer connected to the DevTools hooks. -// 2. This enables us to work around the on-renderer limitation. -// TODO This (or the resetModules below) might be the cause of the hooks erorr in some tests -const ReactTestRenderer = require.requireActual('react-test-renderer'); - -jest.resetModules(); - -jest.mock('react-test-renderer', () => ReactTestRenderer); - // DevTools stores preferences between sessions in localStorage if (!global.hasOwnProperty('localStorage')) { global.localStorage = require('local-storage-fallback').default;