@madie/madie-design-system 1.2.73 → 1.2.75
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/components/MadieDeleteDialog/MadieDeleteDialog.stories.js +25 -0
- package/components/MadieDeleteDialog/index.jsx +18 -1
- package/components/TextField/index.jsx +1 -1
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +10 -10
- package/dist/react/index.js.map +1 -1
- package/package.json +2 -1
- package/test/components/MadieDeleteDialog.test.js +31 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@madie/madie-design-system",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.75",
|
|
4
4
|
"description": "Shared style guide across the Madie program.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
|
|
@@ -133,6 +133,7 @@
|
|
|
133
133
|
"d3-shape": "^1.3.7",
|
|
134
134
|
"dayjs": "^1.11.7",
|
|
135
135
|
"dompurify": "^3.2.6",
|
|
136
|
+
"html-react-parser": "^5.2.6",
|
|
136
137
|
"jwt-decode": "^3.1.2",
|
|
137
138
|
"lodash": "^4.17.21",
|
|
138
139
|
"preact": "^10.6.4",
|
|
@@ -108,4 +108,35 @@ describe("MadieDeleteDialog", () => {
|
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
|
+
|
|
112
|
+
test("Dialog strip out html tags", async () => {
|
|
113
|
+
await act(async () => {
|
|
114
|
+
const { getByTestId, queryByText, getByText } = await render(
|
|
115
|
+
<MadieDeleteDialog
|
|
116
|
+
open={true}
|
|
117
|
+
onClose={() => setDialogOpen(false)}
|
|
118
|
+
onContinue={() => setDialogOpen(false)}
|
|
119
|
+
hideWarning={true}
|
|
120
|
+
dialogTitle="Delete Measure Reference"
|
|
121
|
+
name={"<p><strong>test &</strong></p><p>test2</p>"}
|
|
122
|
+
/>
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const deleteDialog = await getByTestId("delete-dialog");
|
|
126
|
+
expect(deleteDialog).toBeInTheDocument();
|
|
127
|
+
await waitFor(() => {
|
|
128
|
+
expect(
|
|
129
|
+
queryByText("Are you sure you want to delete ?")
|
|
130
|
+
).toBeVisible();
|
|
131
|
+
expect(
|
|
132
|
+
queryByText("This Action cannot be undone.")
|
|
133
|
+
).not.toBeInTheDocument();
|
|
134
|
+
expect(
|
|
135
|
+
queryByText("<p><strong>test &</strong></p><p>test2</p>"),
|
|
136
|
+
).not.toBeInTheDocument();
|
|
137
|
+
expect(getByText("test &")).toBeInTheDocument();
|
|
138
|
+
expect(getByText("test2")).toBeInTheDocument();
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
});
|
|
111
142
|
});
|