Skip to content

Commit

Permalink
Remove duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Silbermann committed Feb 18, 2024
1 parent d0a4b61 commit b173f2e
Showing 1 changed file with 0 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1731,61 +1731,6 @@ describe('InspectedElement', () => {
`);
});

it('should use the displayName of the Context when naming the useContext hook', async () => {
const NamedContext = React.createContext(0);
NamedContext.displayName = 'NamedContext';
const AnonymousContext = React.createContext(1);
const Example = () => {
React.useContext(NamedContext);
React.useContext(AnonymousContext);
return null;
};

const container = document.createElement('div');
await utils.actAsync(() => legacyRender(<Example />, container));

const inspectedElement = await inspectElementAtIndex(0);
expect(inspectedElement).toMatchInlineSnapshot(`
Object {
"context": null,
"events": undefined,
"hooks": Array [
Object {
"hookSource": Object {
"columnNumber": "removed by Jest serializer",
"fileName": "react-devtools-shared/src/__tests__/inspectedElement-test.js",
"functionName": "Example",
"lineNumber": "removed by Jest serializer",
},
"id": null,
"isStateEditable": false,
"name": "NamedContext",
"subHooks": Array [],
"value": 0,
},
Object {
"hookSource": Object {
"columnNumber": "removed by Jest serializer",
"fileName": "react-devtools-shared/src/__tests__/inspectedElement-test.js",
"functionName": "Example",
"lineNumber": "removed by Jest serializer",
},
"id": null,
"isStateEditable": false,
"name": "Context",
"subHooks": Array [],
"value": 1,
},
],
"id": 2,
"owners": null,
"props": Object {},
"rootType": "render()",
"state": null,
}
`);
});

it('should enable inspected values to be stored as global variables', async () => {
const Example = () => null;

Expand Down

0 comments on commit b173f2e

Please sign in to comment.