Skip to content

Commit 83cff6d

Browse files
committed
test: update unit tests for charts
1 parent bbb99d0 commit 83cff6d

File tree

24 files changed

+5403
-770
lines changed

24 files changed

+5403
-770
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js")
2+
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js"),
3+
testEnvironment: "@happy-dom/jest-environment"
34
};

packages/pluggableWidgets/area-chart-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"plotly.js-dist-min": "^3.0.0"
4444
},
4545
"devDependencies": {
46+
"@happy-dom/jest-environment": "^18.0.1",
4647
"@mendix/automation-utils": "workspace:*",
4748
"@mendix/eslint-config-web-widgets": "workspace:*",
4849
"@mendix/pluggable-widgets-tools": "*",

packages/pluggableWidgets/area-chart-web/src/__tests__/AreaChart.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import { createElement } from "react";
1414
import { SeriesType } from "../../typings/AreaChartProps";
1515
import { AreaChart } from "../AreaChart";
1616

17-
jest.mock("react-plotly.js", () => jest.fn(() => null));
18-
1917
describe("The AreaChart widget", () => {
2018
function renderAreaChart(configs: Array<Partial<SeriesType>>): RenderResult {
2119
return render(
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js")
2+
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js"),
3+
testEnvironment: "@happy-dom/jest-environment"
34
};

packages/pluggableWidgets/bar-chart-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"plotly.js-dist-min": "^3.0.0"
4444
},
4545
"devDependencies": {
46+
"@happy-dom/jest-environment": "^18.0.1",
4647
"@mendix/automation-utils": "workspace:*",
4748
"@mendix/eslint-config-web-widgets": "workspace:*",
4849
"@mendix/pluggable-widgets-tools": "*",
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js")
2+
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js"),
3+
testEnvironment: "@happy-dom/jest-environment"
34
};

packages/pluggableWidgets/bubble-chart-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"plotly.js-dist-min": "^3.0.0"
4444
},
4545
"devDependencies": {
46+
"@happy-dom/jest-environment": "^18.0.1",
4647
"@mendix/automation-utils": "workspace:*",
4748
"@mendix/eslint-config-web-widgets": "workspace:*",
4849
"@mendix/pluggable-widgets-tools": "*",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js"),
3+
testEnvironment: "@happy-dom/jest-environment"
4+
};

packages/pluggableWidgets/column-chart-web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"lint": "eslint src/ package.json",
3636
"release": "pluggable-widgets-tools release:web",
3737
"start": "pluggable-widgets-tools start:server",
38-
"test": "pluggable-widgets-tools test:unit:web",
38+
"test": "jest --projects jest.config.js",
3939
"update-changelog": "rui-update-changelog-widget",
4040
"verify": "rui-verify-package-format"
4141
},
@@ -45,6 +45,7 @@
4545
"plotly.js-dist-min": "^3.0.0"
4646
},
4747
"devDependencies": {
48+
"@happy-dom/jest-environment": "^18.0.1",
4849
"@mendix/automation-utils": "workspace:*",
4950
"@mendix/eslint-config-web-widgets": "workspace:*",
5051
"@mendix/pluggable-widgets-tools": "*",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
...require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js"),
3+
testEnvironment: "@happy-dom/jest-environment"
4+
};

0 commit comments

Comments
 (0)