Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 61c79fa

Browse files
irfanhuddajasonLaster
authored andcommitted
Use L10N for unit test (#3007)
* Use L10N for unit tests * Fix testcases
1 parent 959eaa5 commit 61c79fa

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ ShallowWrapper {
13071307
<div
13081308
className="pane-info empty"
13091309
>
1310-
callStack.notPaused
1310+
Not Paused
13111311
</div>
13121312
</div>,
13131313
"nodes": Array [
@@ -1317,7 +1317,7 @@ ShallowWrapper {
13171317
<div
13181318
className="pane-info empty"
13191319
>
1320-
callStack.notPaused
1320+
Not Paused
13211321
</div>
13221322
</div>,
13231323
],
@@ -1382,7 +1382,7 @@ ShallowWrapper {
13821382
<div
13831383
className="pane-info empty"
13841384
>
1385-
callStack.notPaused
1385+
Not Paused
13861386
</div>
13871387
</div>,
13881388
"_debugID": 2,
@@ -1392,7 +1392,7 @@ ShallowWrapper {
13921392
<div
13931393
className="pane-info empty"
13941394
>
1395-
callStack.notPaused
1395+
Not Paused
13961396
</div>
13971397
</div>,
13981398
},
@@ -1568,7 +1568,7 @@ ShallowWrapper {
15681568
className="show-more"
15691569
onClick={[Function]}
15701570
>
1571-
callStack.expand
1571+
Expand Rows
15721572
</div>
15731573
</div>,
15741574
"nodes": Array [
@@ -1714,7 +1714,7 @@ ShallowWrapper {
17141714
className="show-more"
17151715
onClick={[Function]}
17161716
>
1717-
callStack.expand
1717+
Expand Rows
17181718
</div>
17191719
</div>,
17201720
],
@@ -1973,7 +1973,7 @@ ShallowWrapper {
19731973
className="show-more"
19741974
onClick={[Function]}
19751975
>
1976-
callStack.expand
1976+
Expand Rows
19771977
</div>
19781978
</div>,
19791979
"_debugID": 6,
@@ -2119,7 +2119,7 @@ ShallowWrapper {
21192119
className="show-more"
21202120
onClick={[Function]}
21212121
>
2122-
callStack.expand
2122+
Expand Rows
21232123
</div>
21242124
</div>,
21252125
},

src/components/tests/__snapshots__/WhyPaused.js.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ShallowWrapper {
1212
className="pane why-paused"
1313
>
1414
<div>
15-
whyPaused.breakpoint
15+
Paused on breakpoint
1616
</div>
1717
<div
1818
className="message"
@@ -25,7 +25,7 @@ ShallowWrapper {
2525
className="pane why-paused"
2626
>
2727
<div>
28-
whyPaused.breakpoint
28+
Paused on breakpoint
2929
</div>
3030
<div
3131
className="message"
@@ -88,7 +88,7 @@ ShallowWrapper {
8888
className="pane why-paused"
8989
>
9090
<div>
91-
whyPaused.breakpoint
91+
Paused on breakpoint
9292
</div>
9393
<div
9494
className="message"
@@ -101,7 +101,7 @@ ShallowWrapper {
101101
className="pane why-paused"
102102
>
103103
<div>
104-
whyPaused.breakpoint
104+
Paused on breakpoint
105105
</div>
106106
<div
107107
className="message"
@@ -145,7 +145,7 @@ ShallowWrapper {
145145
className="pane why-paused"
146146
>
147147
<div>
148-
whyPaused.exception
148+
Paused on exception
149149
</div>
150150
<div
151151
className="message"
@@ -158,7 +158,7 @@ ShallowWrapper {
158158
className="pane why-paused"
159159
>
160160
<div>
161-
whyPaused.exception
161+
Paused on exception
162162
</div>
163163
<div
164164
className="message"
@@ -233,7 +233,7 @@ ShallowWrapper {
233233
className="pane why-paused"
234234
>
235235
<div>
236-
whyPaused.exception
236+
Paused on exception
237237
</div>
238238
<div
239239
className="message"
@@ -246,7 +246,7 @@ ShallowWrapper {
246246
className="pane why-paused"
247247
>
248248
<div>
249-
whyPaused.exception
249+
Paused on exception
250250
</div>
251251
<div
252252
className="message"
@@ -296,7 +296,7 @@ ShallowWrapper {
296296
className="pane why-paused"
297297
>
298298
<div>
299-
whyPaused.exception
299+
Paused on exception
300300
</div>
301301
<div
302302
className="message"
@@ -309,7 +309,7 @@ ShallowWrapper {
309309
className="pane why-paused"
310310
>
311311
<div>
312-
whyPaused.exception
312+
Paused on exception
313313
</div>
314314
<div
315315
className="message"
@@ -372,7 +372,7 @@ ShallowWrapper {
372372
className="pane why-paused"
373373
>
374374
<div>
375-
whyPaused.exception
375+
Paused on exception
376376
</div>
377377
<div
378378
className="message"
@@ -385,7 +385,7 @@ ShallowWrapper {
385385
className="pane why-paused"
386386
>
387387
<div>
388-
whyPaused.exception
388+
Paused on exception
389389
</div>
390390
<div
391391
className="message"

src/test/tests-setup.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
global.Worker = require("workerjs");
2-
global.L10N = { getStr: value => value };
32

43
const path = require("path");
54
const getConfig = require("../../bin/getConfig");
65
const { setConfig } = require("devtools-config");
6+
const { readFileSync } = require("fs");
77

88
const rootPath = path.join(__dirname, "../../");
99

@@ -20,4 +20,8 @@ const config = Object.assign({}, envConfig, {
2020
});
2121

2222
global.DebuggerConfig = config;
23+
24+
global.L10N = require("devtools-launchpad").L10N;
25+
global.L10N.setBundle(readFileSync("./assets/panel/debugger.properties"));
26+
2327
setConfig(config);

0 commit comments

Comments
 (0)