@madie/madie-design-system 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@madie/madie-design-system",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Shared style guide across the Madie program.",
|
|
5
5
|
"homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
|
|
6
6
|
"main": "./components/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build-react": "webpack --progress --config webpack.config.react.mjs && echo '{ \"type\": \"module\" }' > dist/react/package.json",
|
|
18
18
|
"build-react-watch": "webpack --progress --watch --config webpack.config.react.mjs",
|
|
19
19
|
"start": "npm run build",
|
|
20
|
-
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
|
|
20
|
+
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
|
|
21
21
|
"watch-tests": "cross-env BABEL_ENV=test jest --watch",
|
|
22
22
|
"coverage": "cross-env BABEL_ENV=test jest --coverage",
|
|
23
23
|
"precommit": "npm run format && npm run lint && npm run format-styles",
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
"dayjs": "^1.11.7",
|
|
112
112
|
"dompurify": "^3.2.6",
|
|
113
113
|
"feather-icons-react": "^0.9.0",
|
|
114
|
+
"html-react-parser": "^5.2.6",
|
|
114
115
|
"jwt-decode": "^3.1.2",
|
|
115
116
|
"lodash": "^4.17.21",
|
|
116
117
|
"preact": "^10.6.4",
|
|
@@ -24,7 +24,7 @@ const DialogTester = () => {
|
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const { findByTestId, getByTestId, queryByText } = screen;
|
|
27
|
+
const { findByTestId, getByTestId, queryByText, getByText } = screen;
|
|
28
28
|
describe("MadieDeleteDialog", () => {
|
|
29
29
|
test("Dialog renders", async () => {
|
|
30
30
|
render(<DialogTester />);
|
|
@@ -90,4 +90,33 @@ describe("MadieDeleteDialog", () => {
|
|
|
90
90
|
).not.toBeInTheDocument();
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
|
+
|
|
94
|
+
test("Dialog strip out html tags", async () => {
|
|
95
|
+
render(
|
|
96
|
+
<MadieDeleteDialog
|
|
97
|
+
open={true}
|
|
98
|
+
onClose={() => setDialogOpen(false)}
|
|
99
|
+
onContinue={() => setDialogOpen(false)}
|
|
100
|
+
hideWarning={true}
|
|
101
|
+
dialogTitle="Delete Measure Reference"
|
|
102
|
+
name={"<p><strong>test &</strong></p><p>test2</p>"}
|
|
103
|
+
/>,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const deleteDialog = await getByTestId("delete-dialog");
|
|
107
|
+
expect(deleteDialog).toBeInTheDocument();
|
|
108
|
+
await waitFor(() => {
|
|
109
|
+
expect(
|
|
110
|
+
queryByText("Are you sure you want to delete ?"),
|
|
111
|
+
).toBeVisible();
|
|
112
|
+
expect(
|
|
113
|
+
queryByText("This Action cannot be undone."),
|
|
114
|
+
).not.toBeInTheDocument();
|
|
115
|
+
expect(
|
|
116
|
+
queryByText("<p><strong>test &</strong></p><p>test2</p>"),
|
|
117
|
+
).not.toBeInTheDocument();
|
|
118
|
+
expect(getByText("test &")).toBeInTheDocument();
|
|
119
|
+
expect(getByText("test2")).toBeInTheDocument();
|
|
120
|
+
});
|
|
121
|
+
});
|
|
93
122
|
});
|