Skip to content

Commit 5d93e1e

Browse files
netilJae Sung Park
and
Jae Sung Park
committed
test(all): fix test fails on ci (#3980)
- as local env and ci env browser rendering differences, make to ci ran on macos - fix test fails on ci Co-authored-by: Jae Sung Park <[email protected]>
1 parent a114a31 commit 5d93e1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+519
-258
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
permissions:
99
checks: write # for coverallsapp/github-action to create new checks
1010
contents: read # for actions/checkout to fetch code
11-
runs-on: ubuntu-latest
11+
runs-on: macos-latest
1212
strategy:
1313
matrix:
1414
node-version: [18.x, 19.x, 20.x]

test/api/axis-spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("API axis", function() {
7070
});
7171

7272
done(1);
73-
}, 300);
73+
}, 350);
7474
}));
7575

7676
it("should update y axis label", () => new Promise(done => {
@@ -87,7 +87,7 @@ describe("API axis", function() {
8787
expect(label.attr("dy")).to.be.equal("-0.5em");
8888

8989
done(1);
90-
}, 300);
90+
}, 350);
9191
}));
9292

9393
it("should return axis labels", () => {
@@ -133,7 +133,7 @@ describe("API axis", function() {
133133
expect(tspan.empty()).to.be.false;
134134

135135
done(1);
136-
}, 300);
136+
}, 350);
137137
}));
138138

139139
it("should update axis max value", () => new Promise(done => {
@@ -167,7 +167,7 @@ describe("API axis", function() {
167167
expect(+tspan[tspan.length - 1].innerHTML).to.be.equal(y2);
168168

169169
done(1);
170-
}, 300);
170+
}, 350);
171171
}));
172172

173173
it("axis.min(): check unset & shorthand", () => {
@@ -301,7 +301,7 @@ describe("API axis", function() {
301301
expect(tspan.size()).to.be.equal(2);
302302

303303
done(1);
304-
}, 300);
304+
}, 350);
305305
}));
306306

307307
it("axis.range(): check unset & shorthand", () => {

test/api/chart-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe("API chart", () => {
139139

140140
chart.destroy();
141141
setTimeout(done, 500);
142-
}, 300);
142+
}, 350);
143143
}));
144144

145145
it("should not throw error when already destroyed", () => {

test/api/data-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe("API data", function() {
217217
.to.be.equal("#ff0000");
218218

219219
done(1);
220-
}, 300);
220+
}, 350);
221221
}));
222222

223223
});
@@ -255,7 +255,7 @@ describe("API data", function() {
255255
.to.be.equal("0");
256256

257257
done(1);
258-
}, 300);
258+
}, 350);
259259
}));
260260
});
261261

test/api/export-spec.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe("API export", () => {
6161

6262
done(1);
6363
});
64-
}, 300);
64+
}, 350);
6565
}));
6666

6767
it("should export in different aspectRatio", () => new Promise(done => {
@@ -75,7 +75,7 @@ describe("API export", () => {
7575

7676
done(1);
7777
});
78-
}, 300);
78+
}, 350);
7979
}));
8080

8181
it("set options", () => {
@@ -126,7 +126,7 @@ describe("API export", () => {
126126
expect(data.indexOf(expectedDataURL) > -1).to.be.true;
127127
done(1);
128128
});
129-
}, 300);
129+
}, 350);
130130
}));
131131

132132
it("should export valid svg even with weird css", () => {
@@ -229,8 +229,9 @@ describe("API export", () => {
229229

230230
// pattern for CI: preserveFontStyle=true
231231
[
232-
"gAOUNIIJ4E4iSYKADjOUfrHhUFYN2Rc8AQE6AADHFy6BoJ1ECAArAGeOwaTwIUgPHMK6OqjgAFYHXc2IsEwk6AAjDsGaJ",
233-
"spOAJ4xgEsgAAAABJRU5ErkJggg=="
232+
"HQCFIBBzxD9azoBCsCmI2eHASZAARjg5NA1EqiDAAVgHfDYNJoEKACjmVdGVRsBCsDauLEVCQSdAAVg0",
233+
"J8nNbCY0ESCDEBBoxYmamMDtzmzreKjrguRiROUrGTP2a6TVzIvbop1z5WLgpAP16E",
234+
"VXtTm0WTFpt5X9gadzrcuXpjvfn2remIFuuW1WaWwZOm1Q7d0s1EBQDfVzLEuAcAcBXSh"
234235
]
235236
];
236237

test/api/flow-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe("API flow", () => {
143143
clearInterval(interval);
144144

145145
moved.reduce((a, c) => {
146-
expect(a >= c - 5).to.be.true;
146+
expect(a >= c - 10).to.be.true;
147147
return a + c;
148148
});
149149

test/api/focus-spec.ts

+22-22
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe("API focus", function() {
9090
expect(legendItems.data3.classed(itemFocused)).to.not.be.ok;
9191

9292
done(1);
93-
}, 300);
93+
}, 350);
9494
}));
9595

9696
it("should focus multiple targets", () => new Promise(done => {
@@ -119,7 +119,7 @@ describe("API focus", function() {
119119
expect(legendItems.data3.classed(itemFocused)).to.not.be.ok;
120120

121121
done(1);
122-
}, 300);
122+
}, 350);
123123
}));
124124
});
125125

@@ -146,7 +146,7 @@ describe("API focus", function() {
146146
});
147147

148148
done(1);
149-
}, 300);
149+
}, 350);
150150
}));
151151

152152

@@ -214,7 +214,7 @@ describe("API focus", function() {
214214
});
215215

216216
done(1);
217-
}, 300);
217+
}, 350);
218218
}));
219219

220220
it("should defocus multiple targets after focused", () => new Promise(done => {
@@ -253,8 +253,8 @@ describe("API focus", function() {
253253
).to.be.ok;
254254

255255
done(1);
256-
}, 300);
257-
}, 300);
256+
}, 350);
257+
}, 350);
258258
}));
259259
});
260260

@@ -284,8 +284,8 @@ describe("API focus", function() {
284284
});
285285

286286
done(1);
287-
}, 300);
288-
}, 300);
287+
}, 350);
288+
}, 350);
289289
}));
290290

291291
it("should revert all targets after defocus", () => new Promise(done => {
@@ -313,8 +313,8 @@ describe("API focus", function() {
313313
});
314314

315315
done(1);
316-
}, 300);
317-
}, 300);
316+
}, 350);
317+
}, 350);
318318
}));
319319

320320
it("should revert one target after focus", () => new Promise(done => {
@@ -361,8 +361,8 @@ describe("API focus", function() {
361361
expect(legendItems.data3.classed(itemFocused)).to.be.ok;
362362

363363
done(1);
364-
}, 300);
365-
}, 300);
364+
}, 350);
365+
}, 350);
366366
}));
367367

368368
it("should revert one target after defocus", () => new Promise(done => {
@@ -401,8 +401,8 @@ describe("API focus", function() {
401401
expect(legendItems.data3.classed(itemFocused)).to.not.be.ok;
402402

403403
done(1);
404-
}, 300);
405-
}, 300);
404+
}, 350);
405+
}, 350);
406406
}));
407407

408408
it("should focus multiple targets after focus", () => new Promise(done => {
@@ -451,8 +451,8 @@ describe("API focus", function() {
451451
expect(legendItems.data3.classed(itemFocused)).to.be.ok;
452452

453453
done(1);
454-
}, 300);
455-
}, 300);
454+
}, 350);
455+
}, 350);
456456
}));
457457

458458
it("should focus multiple targets after defocus", () => new Promise(done => {
@@ -496,8 +496,8 @@ describe("API focus", function() {
496496
expect(legendItems.data3.classed(itemFocused)).to.not.be.ok;
497497

498498
done(1);
499-
}, 300);
500-
}, 300);
499+
}, 350);
500+
}, 350);
501501
}));
502502

503503
});
@@ -541,7 +541,7 @@ describe("API focus", function() {
541541
expect(legend).to.be.null;
542542

543543
done(1);
544-
}, 300);
544+
}, 350);
545545
}));
546546

547547
it("should defocus all targets without showing legend", () => new Promise(done => {
@@ -559,7 +559,7 @@ describe("API focus", function() {
559559
expect(legend).to.be.null;
560560

561561
done(1);
562-
}, 300);
562+
}, 350);
563563
}));
564564

565565
it("should revert all targets after focus", () => new Promise(done => {
@@ -580,8 +580,8 @@ describe("API focus", function() {
580580
expect(legend).to.be.null;
581581

582582
done(1);
583-
}, 300);
584-
}, 300);
583+
}, 350);
584+
}, 350);
585585
}));
586586
});
587587
});

test/api/grid-spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {select as d3Select} from "d3-selection";
88
import util from "../assets/util";
99
import {$GRID} from "../../src/config/classes";
1010

11-
describe.skip("API grid", function() {
11+
describe("API grid", function() {
1212
let chart;
1313

1414
beforeAll(() => {
@@ -64,7 +64,7 @@ describe.skip("API grid", function() {
6464

6565
expect(grids.size()).to.be.equal(0);
6666
done(1);
67-
}, 300);
67+
}, 350);
6868
}));
6969

7070
it("should update x ygrids even if it's zoomed", () => new Promise(done => {
@@ -119,9 +119,9 @@ describe.skip("API grid", function() {
119119

120120
expect(grids.size()).to.be.equal(0);
121121
done(1);
122-
}, 300);
123-
}, 300);
124-
}, 300);
122+
}, 350);
123+
}, 350);
124+
}, 350);
125125
}));
126126
});
127127

test/api/legend-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe("API legend", () => {
4949
});
5050

5151
done(1);
52-
}, 300)
52+
}, 350)
5353
}));
5454

5555
it("it should hide 'data1' legend", () => {
@@ -70,6 +70,6 @@ describe("API legend", () => {
7070
});
7171

7272
done(1);
73-
}, 300);
73+
}, 350);
7474
}));
7575
});

test/api/load-spec.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe("API load", function() {
106106
done(1);
107107
}
108108
});
109-
}, 300);
109+
}, 350);
110110
}));
111111
});
112112

@@ -390,7 +390,7 @@ describe("API load", function() {
390390
setTimeout(() => {
391391
expect(+axisLabel.attr("dy")).to.be.below(dy);
392392
done(1);
393-
}, 300);
393+
}, 350);
394394
}
395395
});
396396
}));
@@ -586,7 +586,7 @@ describe("API load", function() {
586586
done(1);
587587
}
588588
});
589-
}, 300);
589+
}, 350);
590590
}));
591591

592592
it("set options data.type='area'", () => {
@@ -614,7 +614,7 @@ describe("API load", function() {
614614
done(1);
615615
}
616616
});
617-
}, 300);
617+
}, 350);
618618
}));
619619
});
620620

@@ -1079,7 +1079,7 @@ describe("API load", function() {
10791079
expect(lastLegend.getBoundingClientRect().bottom).to.be.below(chartNode.getBoundingClientRect().bottom);
10801080

10811081
done(1);
1082-
}, 300);
1082+
}, 350);
10831083
}
10841084
});
10851085
}));
@@ -1107,7 +1107,7 @@ describe("API load", function() {
11071107
expect(lastLegend.getBoundingClientRect().bottom).to.be.above(chartNode.getBoundingClientRect().bottom);
11081108

11091109
done(1);
1110-
}, 300);
1110+
}, 350);
11111111
}
11121112
});
11131113
}));
@@ -1140,7 +1140,7 @@ describe("API load", function() {
11401140
expect(legendBottom < chartBottom).to.be.true;
11411141

11421142
done(1);
1143-
}, 300);
1143+
}, 350);
11441144
}
11451145
})
11461146
}
@@ -1175,7 +1175,7 @@ describe("API load", function() {
11751175
expect(chartBottom - legendBottom > 25).to.be.true;
11761176

11771177
done(1);
1178-
}, 300);
1178+
}, 350);
11791179
}
11801180
})
11811181
}

0 commit comments

Comments
 (0)