Skip to content

Commit d0a4b61

Browse files
author
Sebastian Silbermann
committed
f
1 parent 4b7d443 commit d0a4b61

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,11 @@ describe('ReactHooksInspectionIntegration', () => {
772772

773773
it('should inspect the value of the current provider in useContext', () => {
774774
const MyContext = React.createContext('default');
775+
const ThemeContext = React.createContext('default');
776+
ThemeContext.displayName = 'Theme';
775777
function Foo(props) {
776778
const value = React.useContext(MyContext);
779+
React.useContext(ThemeContext);
777780
return <div>{value}</div>;
778781
}
779782
const renderer = ReactTestRenderer.create(
@@ -799,6 +802,20 @@ describe('ReactHooksInspectionIntegration', () => {
799802
"subHooks": [],
800803
"value": "contextual",
801804
},
805+
{
806+
"debugInfo": null,
807+
"hookSource": {
808+
"columnNumber": 0,
809+
"fileName": "**",
810+
"functionName": "Foo",
811+
"lineNumber": 0,
812+
},
813+
"id": null,
814+
"isStateEditable": false,
815+
"name": "Theme",
816+
"subHooks": [],
817+
"value": "default",
818+
},
802819
]
803820
`);
804821
});

0 commit comments

Comments
 (0)