diff --git a/packages/pluggableWidgets/carousel-web/jest.config.js b/packages/pluggableWidgets/carousel-web/jest.config.js
index 890239bf65..9669dc6e63 100644
--- a/packages/pluggableWidgets/carousel-web/jest.config.js
+++ b/packages/pluggableWidgets/carousel-web/jest.config.js
@@ -1,4 +1,4 @@
-const base = require("@mendix/pluggable-widgets-tools/test-config/jest.config");
+const base = require("@mendix/pluggable-widgets-tools/test-config/jest.enzyme-free.config.js");
module.exports = {
...base,
diff --git a/packages/pluggableWidgets/carousel-web/package.json b/packages/pluggableWidgets/carousel-web/package.json
index ff0403bf72..df4280b261 100644
--- a/packages/pluggableWidgets/carousel-web/package.json
+++ b/packages/pluggableWidgets/carousel-web/package.json
@@ -43,9 +43,7 @@
},
"dependencies": {
"@mendix/widget-plugin-component-kit": "workspace:*",
- "@types/react-test-renderer": "^18.0.7",
"classnames": "^2.5.1",
- "react-test-renderer": "^18.2.0",
"swiper": "^9.4.1"
},
"devDependencies": {
diff --git a/packages/pluggableWidgets/carousel-web/src/components/__tests__/Carousel.spec.tsx b/packages/pluggableWidgets/carousel-web/src/components/__tests__/Carousel.spec.tsx
index 2802b5ca5e..70359033ff 100644
--- a/packages/pluggableWidgets/carousel-web/src/components/__tests__/Carousel.spec.tsx
+++ b/packages/pluggableWidgets/carousel-web/src/components/__tests__/Carousel.spec.tsx
@@ -1,12 +1,13 @@
import { createElement } from "react";
import { Carousel, CarouselProps } from "../Carousel";
-import renderer from "react-test-renderer";
+import { render } from "@testing-library/react";
import { GUID } from "mendix";
-beforeEach(() => {
- jest.resetAllMocks();
-});
describe("Carousel", () => {
+ beforeEach(() => {
+ jest.resetAllMocks();
+ jest.spyOn(Math, "random").mockReturnValue(0.123456789);
+ });
const defaultCarouselProps: CarouselProps = {
id: "Carousel",
className: "",
@@ -24,18 +25,21 @@ describe("Carousel", () => {
};
it("renders correctly", () => {
- const carousel = renderer.create();
+ const { asFragment } = render();
- expect(carousel).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
it("renders correctly without pagination", () => {
- const carousel = renderer.create();
+ const { asFragment } = render();
- expect(carousel).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
it("renders correctly without navigation", () => {
- const carousel = renderer.create();
+ const { asFragment } = render();
- expect(carousel).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
+ });
+ afterEach(() => {
+ jest.restoreAllMocks();
});
});
diff --git a/packages/pluggableWidgets/carousel-web/src/components/__tests__/__snapshots__/Carousel.spec.tsx.snap b/packages/pluggableWidgets/carousel-web/src/components/__tests__/__snapshots__/Carousel.spec.tsx.snap
index 1c42839336..37045c39d3 100644
--- a/packages/pluggableWidgets/carousel-web/src/components/__tests__/__snapshots__/Carousel.spec.tsx.snap
+++ b/packages/pluggableWidgets/carousel-web/src/components/__tests__/__snapshots__/Carousel.spec.tsx.snap
@@ -1,124 +1,214 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Carousel renders correctly 1`] = `
-
-
+
`;
exports[`Carousel renders correctly without navigation 1`] = `
-
-
+
`;
exports[`Carousel renders correctly without pagination 1`] = `
-
-
+
`;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a7a3cb2e71..7f67dd04a0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -694,15 +694,9 @@ importers:
'@mendix/widget-plugin-component-kit':
specifier: workspace:*
version: link:../../shared/widget-plugin-component-kit
- '@types/react-test-renderer':
- specifier: ^18.0.7
- version: 18.0.7
classnames:
specifier: ^2.5.1
version: 2.5.1
- react-test-renderer:
- specifier: ^18.2.0
- version: 18.2.0(react@18.2.0)
swiper:
specifier: ^9.4.1
version: 9.4.1
@@ -4930,9 +4924,6 @@ packages:
'@types/react-plotly.js@2.6.3':
resolution: {integrity: sha512-HBQwyGuu/dGXDsWhnQrhH+xcJSsHvjkwfSRjP+YpOsCCWryIuXF78ZCBjpfgO3sCc0Jo8sYp4NOGtqT7Cn3epQ==}
- '@types/react-test-renderer@18.0.7':
- resolution: {integrity: sha512-1+ANPOWc6rB3IkSnElhjv6VLlKg2dSv/OWClUyZimbLsQyBn8Js9Vtdsi3UICJ2rIQ3k2la06dkB+C92QfhKmg==}
-
'@types/react@18.2.36':
resolution: {integrity: sha512-o9XFsHYLLZ4+sb9CWUYwHqFVoG61SesydF353vFMMsQziiyRu8np4n2OYMUSDZ8XuImxDr9c5tR7gidlH29Vnw==}
@@ -14422,10 +14413,6 @@ snapshots:
'@types/plotly.js': 2.12.30
'@types/react': 18.2.36
- '@types/react-test-renderer@18.0.7':
- dependencies:
- '@types/react': 18.2.36
-
'@types/react@18.2.36':
dependencies:
'@types/prop-types': 15.7.9