Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/generator-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- We migrated the generated unit tests to use React Testing Library instead of enzyme.

- We changed the copyright prompt to prefill the current year.

## [10.24.0] - 2025-09-24

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function promptWidgetProperties(mxProjectDir, widgetName) {
type: "input",
name: "copyright",
message: "Add a copyright",
default: "© Mendix Technology BV 2022. All rights reserved.",
default: `© Mendix Technology BV ${new Date().getFullYear()}. All rights reserved.`,
store: true
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"output": "./dist/testresults/TESTS-Jest.xml"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0"
"@mendix/pluggable-widgets-tools": "^11.3.1"
},
"dependencies": {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"release": "pluggable-widgets-tools release:native"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0"
"@mendix/pluggable-widgets-tools": "^11.3.1"
},
"dependencies": {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"output": "./dist/testresults/TESTS-Jest.xml"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"@types/big.js": "^6.0.2",
"@types/jest": "^29.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"release": "pluggable-widgets-tools release:native"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"@types/big.js": "^6.0.2"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"cypress": "^10.10.0"
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,27 @@
"build": "pluggable-widgets-tools build:web",
"lint": "pluggable-widgets-tools lint",
"lint:fix": "pluggable-widgets-tools lint:fix",
"test": "pluggable-widgets-tools test:unit:web --no-cache --ci && npm run test:e2e",
"test:unit": "pluggable-widgets-tools test:unit:web --coverage",
"test": "pluggable-widgets-tools test:unit:web && npm run test:e2e",
"test:unit": "pluggable-widgets-tools test:unit:web",
"test:e2e": "npx cypress open --browser chrome --e2e",
"prerelease": "npm run lint",
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"cypress": "^10.10.0"
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@
"build": "pluggable-widgets-tools build:web",
"lint": "pluggable-widgets-tools lint",
"lint:fix": "pluggable-widgets-tools lint:fix",
"test": "pluggable-widgets-tools test:unit:web --no-cache --ci",
"test:unit": "pluggable-widgets-tools test:unit:web --coverage",
"test": "pluggable-widgets-tools test:unit:web",
"test:unit": "pluggable-widgets-tools test:unit:web",
"prerelease": "npm run lint",
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0"
"@mendix/pluggable-widgets-tools": "^11.3.1"
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0"
"@mendix/pluggable-widgets-tools": "^11.3.1"
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"@types/big.js": "^6.0.2",
"@types/enzyme": "^3.10.8",
"@types/jasmine": "^3.6.9",
"cypress": "^10.10.0"
},
Expand All @@ -37,12 +36,16 @@
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,34 @@
"build": "pluggable-widgets-tools build:web",
"lint": "pluggable-widgets-tools lint",
"lint:fix": "pluggable-widgets-tools lint:fix",
"test": "pluggable-widgets-tools test:unit:web --no-cache --ci && npm run test:e2e",
"test:unit": "pluggable-widgets-tools test:unit:web --coverage",
"test": "pluggable-widgets-tools test:unit:web && npm run test:e2e",
"test:unit": "pluggable-widgets-tools test:unit:web",
"test:e2e": "npx cypress open --browser chrome --e2e",
"prerelease": "npm run lint",
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"@types/big.js": "^6.0.2",
"@types/enzyme": "^3.10.8",
"@types/jasmine": "^3.6.9",
"@types/jest": "^29.0.0",
"@types/react-test-renderer": "~18.0.0",
"cypress": "^10.10.0"
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,31 @@
"build": "pluggable-widgets-tools build:web",
"lint": "pluggable-widgets-tools lint",
"lint:fix": "pluggable-widgets-tools lint:fix",
"test": "pluggable-widgets-tools test:unit:web --no-cache --ci",
"test:unit": "pluggable-widgets-tools test:unit:web --coverage",
"test": "pluggable-widgets-tools test:unit:web",
"test:unit": "pluggable-widgets-tools test:unit:web",
"prerelease": "npm run lint",
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"@types/big.js": "^6.0.2",
"@types/enzyme": "^3.10.8",
"@types/jest": "^29.0.0",
"@types/react-test-renderer": "~18.0.0"
"@types/jest": "^29.0.0"
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,24 @@
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0",
"@mendix/pluggable-widgets-tools": "^11.3.1",
"@types/big.js": "^6.0.2"
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",
"react-dom": "18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"output": "./dist/testresults/TESTS-Jest.xml"
},<% } %>
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0"<% if (isLanguageTS) { %>,
"@mendix/pluggable-widgets-tools": "^11.3.1"<% if (isLanguageTS) { %>,
"@types/big.js": "^6.0.2"<% if (hasUnitTests) { %>,
"@types/jest": "^29.0.0"<% } %><% } %>
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,34 @@
"build": "pluggable-widgets-tools build:web",
"lint": "pluggable-widgets-tools lint",
"lint:fix": "pluggable-widgets-tools lint:fix",<% if (hasUnitTests) { %>
"test": "pluggable-widgets-tools test:unit:web --no-cache --ci<% if (hasE2eTests) { %> && npm run test:e2e<% } %>",
"test:unit": "pluggable-widgets-tools test:unit:web --coverage",<% } %><% if (hasE2eTests) { %>
"test": "pluggable-widgets-tools test:unit:web<% if (hasE2eTests) { %> && npm run test:e2e<% } %>",
"test:unit": "pluggable-widgets-tools test:unit:web",<% } %><% if (hasE2eTests) { %>
"test:e2e": "npx cypress open --browser chrome --e2e",<% } %>
"prerelease": "npm run lint",
"release": "pluggable-widgets-tools release:web"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.15.0"<% if (isLanguageTS) { %>,
"@types/big.js": "^6.0.2"<% if (hasUnitTests || hasE2eTests) { %>,
"@types/enzyme": "^3.10.8"<% } %><% if (hasE2eTests) { %>,
"@mendix/pluggable-widgets-tools": "^11.3.1"<% if (isLanguageTS) { %>,
"@types/big.js": "^6.0.2"<% if (hasE2eTests) { %>,
"@types/jasmine": "^3.6.9"<% } %><% if (hasUnitTests) { %>,
"@types/jest": "^29.0.0",
"@types/react-test-renderer": "~18.0.0"<% } %><% } %><% if (hasE2eTests) { %>,
"@types/jest": "^29.0.0"<% } %><% } %><% if (hasE2eTests) { %>,
"cypress": "^10.10.0"<% } %>
},
"dependencies": {
"classnames": "^2.2.6"
},
"resolutions": {
"react": "^18.2.0",<% if (isLanguageTS) { %>
"@types/react": "^18.2.0",<% } %>
"react": "^18.2.0",
"react-dom": "18.2.0",<% if (isLanguageTS) { %>
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",<% } %>
"react-native": "0.72.7"
},
"overrides": {
"react": "^18.2.0",<% if (isLanguageTS) { %>
"@types/react": "^18.2.0",<% } %>
"react": "^18.2.0",
"react-dom": "18.2.0",<% if (isLanguageTS) { %>
"@types/react": "^18.2.0",
"@types/react-dom": "18.2.0",<% } %>
"react-native": "0.72.7"
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import { createElement } from "react";
import { shallow } from "enzyme";
import { render } from "@testing-library/react";
import "@testing-library/jest-dom";

import { HelloWorldSample } from "../HelloWorldSample";

describe("HelloWorldSample", () => {
const createHelloWorld = (props) => shallow(<HelloWorldSample {...props} />);

it("should render the structure correctly", () => {
const helloWorldProps = {
sampleText: "World"
};
const helloWorld = createHelloWorld(helloWorldProps);

expect(
helloWorld.equals(
<div className="widget-hello-world">Hello {helloWorldProps.sampleText}</div>
)
).toEqual(true);
const { container } = render(<HelloWorldSample {...helloWorldProps} />);

const helloWorld = container.querySelector(".widget-hello-world");
expect(helloWorld).toBeInTheDocument();
expect(helloWorld).toHaveTextContent(`Hello ${helloWorldProps.sampleText}`);
});
});
Loading
Loading