Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit cf6a7f8

Browse files
committed
Use devtools-components-0.3.0 in devtools-reps.
Some snapshots are updated since the tree was modified (aria-level), and formatObjectInspector is updated to address this.
1 parent 05781e3 commit cf6a7f8

File tree

5 files changed

+113
-3287
lines changed

5 files changed

+113
-3287
lines changed

packages/devtools-reps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"dependencies": {
2828
"classnames": "^2.2.5",
29-
"devtools-components": "^0.2.0",
29+
"devtools-components": "^0.3.0",
3030
"lodash": "^4.17.2",
3131
"prop-types": "^15.6.0",
3232
"react": "^16.2.0",

packages/devtools-reps/src/object-inspector/tests/component/__snapshots__/classnames.js.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`ObjectInspector - classnames has the expected class 1`] = `
2020
tabIndex="0"
2121
>
2222
<div
23-
aria-level={0}
23+
aria-level={1}
2424
className="tree-node"
2525
data-expandable={false}
2626
id="root"
@@ -71,7 +71,7 @@ exports[`ObjectInspector - classnames has the inline class when inline prop is t
7171
tabIndex="0"
7272
>
7373
<div
74-
aria-level={0}
74+
aria-level={1}
7575
className="tree-node"
7676
data-expandable={false}
7777
id="root"
@@ -122,7 +122,7 @@ exports[`ObjectInspector - classnames has the nowrap class when disableWrap prop
122122
tabIndex="0"
123123
>
124124
<div
125-
aria-level={0}
125+
aria-level={1}
126126
className="tree-node"
127127
data-expandable={false}
128128
id="root"

packages/devtools-reps/src/object-inspector/tests/component/__snapshots__/window.js.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports[`ObjectInspector - dimTopLevelWindow renders collapsed top-level window
2121
>
2222
<div
2323
aria-expanded={false}
24-
aria-level={0}
24+
aria-level={1}
2525
className="tree-node"
2626
data-expandable={true}
2727
id="windowpath"
@@ -87,7 +87,7 @@ exports[`ObjectInspector - dimTopLevelWindow renders collapsed top-level window
8787
>
8888
<div
8989
aria-expanded={false}
90-
aria-level={0}
90+
aria-level={1}
9191
className="tree-node"
9292
data-expandable={true}
9393
id="windowpath"
@@ -153,7 +153,7 @@ exports[`ObjectInspector - dimTopLevelWindow renders expanded top-level window w
153153
>
154154
<div
155155
aria-expanded={true}
156-
aria-level={0}
156+
aria-level={1}
157157
className="tree-node"
158158
data-expandable={true}
159159
id="windowpath"
@@ -219,7 +219,7 @@ exports[`ObjectInspector - dimTopLevelWindow renders sub-level window 1`] = `
219219
>
220220
<div
221221
aria-expanded={true}
222-
aria-level={0}
222+
aria-level={1}
223223
className="tree-node"
224224
data-expandable={true}
225225
id="rootpath"
@@ -248,7 +248,7 @@ exports[`ObjectInspector - dimTopLevelWindow renders sub-level window 1`] = `
248248
</div>
249249
<div
250250
aria-expanded={false}
251-
aria-level={1}
251+
aria-level={2}
252252
className="tree-node"
253253
data-expandable={true}
254254
id="windowpath"

packages/devtools-reps/src/object-inspector/tests/test-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const {WAIT_UNTIL_TYPE} = require("../../shared/redux/middleware/waitUntilServic
2525
function formatObjectInspector(wrapper: Object) {
2626
return wrapper.find(".tree-node")
2727
.map(node => {
28-
const indentStr = "| ".repeat(node.prop("aria-level") || 0);
28+
const indentStr = "| ".repeat((node.prop("aria-level") || 1) - 1);
2929
// We need to target i.arrow or Enzyme will also match the ArrowExpander component.
3030
const arrow = node.find("i.arrow");
3131
let arrowStr = " ";

0 commit comments

Comments
 (0)