Skip to content

Commit 0a01abc

Browse files
iocalebsjasonLaster
authored andcommitted
[CallStack] Add tests for framework grouping (firefox-devtools#5502)
1 parent 7e8d6f8 commit 0a01abc

File tree

3 files changed

+101
-1
lines changed

3 files changed

+101
-1
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"flow.pathToFlow": "${workspaceRoot}/node_modules/.bin/flow",
33
"eslint.autoFixOnSave": true,
44
"prettier.eslintIntegration": true,
5-
"javascript.validate.enable": false
5+
"javascript.validate.enable": false,
6+
"editor.rulers": [
7+
80
8+
]
69
}

src/components/SecondaryPanes/Frames/tests/Frames.spec.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,32 @@ describe("Frames", () => {
122122
expect(component.find("FrameComponent")).toHaveLength(2);
123123
expect(component).toMatchSnapshot();
124124
});
125+
126+
it("groups all the Webpack-related frames", () => {
127+
const frames = [
128+
{ id: "1-appFrame" },
129+
{
130+
id: "2-webpackBootstrapFrame",
131+
source: { url: "webpack:///webpack/bootstrap 01d88449ca6e9335a66f" }
132+
},
133+
{
134+
id: "3-webpackBundleFrame",
135+
source: { url: "https://foo.com/bundle.js" }
136+
},
137+
{
138+
id: "4-webpackBootstrapFrame",
139+
source: { url: "webpack:///webpack/bootstrap 01d88449ca6e9335a66f" }
140+
},
141+
{
142+
id: "5-webpackBundleFrame",
143+
source: { url: "https://foo.com/bundle.js" }
144+
}
145+
];
146+
const selectedFrame = frames[0];
147+
const frameworkGroupingOn = true;
148+
const component = render({ frames, frameworkGroupingOn, selectedFrame });
149+
150+
expect(component).toMatchSnapshot();
151+
});
125152
});
126153
});

src/components/SecondaryPanes/Frames/tests/__snapshots__/Frames.spec.js.snap

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,76 @@ exports[`Frames Blackboxed Frames filters blackboxed frames 1`] = `
6767
</div>
6868
`;
6969

70+
exports[`Frames Library Frames groups all the Webpack-related frames 1`] = `
71+
<div
72+
className="pane frames"
73+
>
74+
<ul>
75+
<Frame
76+
copyStackTrace={[Function]}
77+
frame={
78+
Object {
79+
"id": "1-appFrame",
80+
}
81+
}
82+
frameworkGroupingOn={true}
83+
hideLocation={false}
84+
key="1-appFrame"
85+
selectFrame={[Function]}
86+
selectedFrame={
87+
Object {
88+
"id": "1-appFrame",
89+
}
90+
}
91+
shouldMapDisplayName={true}
92+
toggleBlackBox={[Function]}
93+
toggleFrameworkGrouping={[Function]}
94+
/>
95+
<Group
96+
copyStackTrace={[Function]}
97+
frameworkGroupingOn={true}
98+
group={
99+
Array [
100+
Object {
101+
"id": "2-webpackBootstrapFrame",
102+
"source": Object {
103+
"url": "webpack:///webpack/bootstrap 01d88449ca6e9335a66f",
104+
},
105+
},
106+
Object {
107+
"id": "3-webpackBundleFrame",
108+
"source": Object {
109+
"url": "https://foo.com/bundle.js",
110+
},
111+
},
112+
Object {
113+
"id": "4-webpackBootstrapFrame",
114+
"source": Object {
115+
"url": "webpack:///webpack/bootstrap 01d88449ca6e9335a66f",
116+
},
117+
},
118+
Object {
119+
"id": "5-webpackBundleFrame",
120+
"source": Object {
121+
"url": "https://foo.com/bundle.js",
122+
},
123+
},
124+
]
125+
}
126+
key="2-webpackBootstrapFrame"
127+
selectFrame={[Function]}
128+
selectedFrame={
129+
Object {
130+
"id": "1-appFrame",
131+
}
132+
}
133+
toggleBlackBox={[Function]}
134+
toggleFrameworkGrouping={[Function]}
135+
/>
136+
</ul>
137+
</div>
138+
`;
139+
70140
exports[`Frames Library Frames toggling framework frames 1`] = `
71141
<div
72142
className="pane frames"

0 commit comments

Comments
 (0)