Skip to content

Commit

Permalink
test(vitest): Update browser provider
Browse files Browse the repository at this point in the history
update from webdriverio:chrome to playwright:chromium

Ref naver#3681
  • Loading branch information
netil authored and netil committed Aug 8, 2024
1 parent 051e821 commit b8d2642
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 1,364 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"lint-staged": "^15.2.7",
"mini-css-extract-plugin": "^2.9.0",
"node-sass": "^9.0.0",
"playwright": "^1.46.0",
"regenerator-runtime": "^0.14.1",
"rollup": "^4.19.1",
"rollup-plugin-delete": "^2.0.0",
Expand All @@ -156,7 +157,6 @@
"typescript": "5.5.4",
"typescript-eslint": "^7.18.0",
"vitest": "^2.0.5",
"webdriverio": "^8.39.1",
"webpack": "^5.93.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-clean": "^1.2.5",
Expand Down
2 changes: 1 addition & 1 deletion test/api/axis-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* billboard.js project is licensed under the MIT license
*/
/* eslint-disable */
import {beforeEach, beforeAll, afterAll, describe, expect, it} from "vitest";
import {beforeAll, afterAll, describe, expect, it} from "vitest";
import {select as d3Select} from "d3-selection";
import util from "../assets/util";
import {$AXIS} from "../../src/config/classes";
Expand Down
1 change: 1 addition & 0 deletions test/api/chart-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ describe("API chart", () => {
expect(/^\(\)\s?=\>\s?\{/.test(chart[key].toString())).to.be.true;
});

// @ts-ignore
expect(bb.instance.indexOf(chart) === -1).to.be.true;

const el = <HTMLDivElement>document.getElementById("chart");
Expand Down
9 changes: 9 additions & 0 deletions test/api/export-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,21 @@ describe("API export", () => {
"gEMwIYvjgilxAsgoYFymZLtEoI4ACaBlzpB5Aqh4u1HAwik2LwOTAFo2",
"n3KPP7RFhvxMH97ZLyZpsgzMpjX2Qk8O3IUePj1WqYqk0kYkwz"
],

// pattern for webdriverio
[
"nSetJ0vvOG1XcoZ8BQEeD3w9CCB6BGIkmCiAIze",
"BhTIwMPCQiOxewt4m8Xj8HxSAQVGnnXoQ0J7YGzDD",
"ANwDC7nf6iqhRcXno2cQP2wnXM4qpFnSLACzpHlfYysmAV1jezaWxGgmFrai6bp9Y6Ryp2AaM"
],

// pattern for playwright
[
"31YqlQ4kAUzcNOyQCCSKAAlgonCzs7QgQAKYFktRzrAIDA8PnyciH2vz3va",
"VSxTBFAVCvG9EcqwrJwaBEx59kIYM9JQYJFFMGbYFyyozdCPQ4p7",
"2vI8zkABqEdwKQD1iANHAPWIAwWgHnHgCGDV4qCTYBoXGfC6I05zJgMYW4lmeko"
],

// pattern for CI: preserveFontStyle=false
[
"CZJgASaSGA5AGcAWG3wNiJg5ybawqZJgARsIEABaAPUclXqU3rWhk",
Expand Down
2 changes: 1 addition & 1 deletion test/internals/axis-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ describe("AXIS", function() {
const xAxisTickRotate = internal.getAxisTickRotate("x");

expect(xAxisTickRotate).to.be.equal(expectedXAxisTickRotate);
expect(xAxisBoundingClientRect.height).to.be.closeTo(expectedXAxisBoundingClientRect, 1);
expect(xAxisBoundingClientRect.height).to.be.closeTo(expectedXAxisBoundingClientRect, 1.5);
expect(horizontalXAxisHeight).to.be.closeTo(expectedHorizontalXAxisHeight, 2);

const xAxisTickTextY2Overflow = chart.internal.axis.getXAxisTickTextY2Overflow(defaultPadding);
Expand Down
2 changes: 1 addition & 1 deletion test/internals/boost-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ describe("BOOST", () => {
done(1);
}
)("abcd");
}));
}), 5000);
});
});
2 changes: 1 addition & 1 deletion test/internals/tooltip-position-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ describe("TOOLTIP Position", function() {

const {y} = chart.$.tooltip.node().getBoundingClientRect();

expect(y > 175).to.be.true;
expect(y >= 175).to.be.true;
});
});
});
2 changes: 1 addition & 1 deletion test/module/module-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@ describe("MODULE", function() {
},
[depsFn]
)();
}));
}), 5000);
});
});
4 changes: 2 additions & 2 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default defineConfig({
],
browser: {
enabled: true,
provider: "webdriverio",
name: "chrome",
provider: "playwright",
name: "chromium",
headless: true,
viewport: {
width: 800,
Expand Down
Loading

0 comments on commit b8d2642

Please sign in to comment.