@truedat/dq 8.3.2 → 8.3.4
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": "@truedat/dq",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.4",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -46,14 +46,17 @@
|
|
|
46
46
|
"rootMode": "upward"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"transformIgnorePatterns": [
|
|
51
|
+
"/node_modules/(?!marked|turndown|@tiptap)/"
|
|
52
|
+
]
|
|
50
53
|
},
|
|
51
54
|
"devDependencies": {
|
|
52
55
|
"@testing-library/dom": "^10.4.0",
|
|
53
56
|
"@testing-library/jest-dom": "^6.6.3",
|
|
54
57
|
"@testing-library/react": "^16.3.0",
|
|
55
58
|
"@testing-library/user-event": "^14.6.1",
|
|
56
|
-
"@truedat/test": "8.3.
|
|
59
|
+
"@truedat/test": "8.3.4",
|
|
57
60
|
"identity-obj-proxy": "^3.0.0",
|
|
58
61
|
"jest": "^29.7.0",
|
|
59
62
|
"redux-saga-test-plan": "^4.0.6"
|
|
@@ -86,5 +89,5 @@
|
|
|
86
89
|
"semantic-ui-react": "^3.0.0-beta.2",
|
|
87
90
|
"swr": "^2.3.3"
|
|
88
91
|
},
|
|
89
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "6c7f4ef08bac69f8b642fa788ebb426a5a103314"
|
|
90
93
|
}
|
|
@@ -105,6 +105,7 @@ export const Subscription = ({
|
|
|
105
105
|
}) => {
|
|
106
106
|
const [subscriptionField, setSubscription] = useState(searchSubscription);
|
|
107
107
|
const [resourceTypeId, setResourceTypeId] = useState();
|
|
108
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
108
109
|
|
|
109
110
|
useEffect(() => {
|
|
110
111
|
setSubscription(searchSubscription);
|
|
@@ -143,6 +144,7 @@ export const Subscription = ({
|
|
|
143
144
|
_.prop("id")(subscriptionField)
|
|
144
145
|
? updateSubscription(payload)
|
|
145
146
|
: createSubscription(payload);
|
|
147
|
+
setIsOpen(false);
|
|
146
148
|
};
|
|
147
149
|
|
|
148
150
|
const resourceName = (resource, resourceType) => {
|
|
@@ -182,7 +184,10 @@ export const Subscription = ({
|
|
|
182
184
|
},
|
|
183
185
|
...resourceTypeId,
|
|
184
186
|
};
|
|
185
|
-
_.prop("id")(subscriptionField)
|
|
187
|
+
if (_.prop("id")(subscriptionField)) {
|
|
188
|
+
deleteSubscription(payload);
|
|
189
|
+
setIsOpen(false);
|
|
190
|
+
}
|
|
186
191
|
};
|
|
187
192
|
|
|
188
193
|
const handleChange = (e, { name, value }) => {
|
|
@@ -200,6 +205,9 @@ export const Subscription = ({
|
|
|
200
205
|
position="bottom right"
|
|
201
206
|
basic
|
|
202
207
|
flowing
|
|
208
|
+
open={isOpen}
|
|
209
|
+
onOpen={() => setIsOpen(true)}
|
|
210
|
+
onClose={() => setIsOpen(false)}
|
|
203
211
|
trigger={
|
|
204
212
|
<Button
|
|
205
213
|
basic
|
|
@@ -64,11 +64,18 @@ describe("<Subscription />", () => {
|
|
|
64
64
|
};
|
|
65
65
|
const subscriptionUpdating = false;
|
|
66
66
|
|
|
67
|
+
const createSubscription = jest.fn();
|
|
68
|
+
const updateSubscription = jest.fn();
|
|
69
|
+
const deleteSubscription = jest.fn();
|
|
70
|
+
|
|
67
71
|
const props = {
|
|
68
72
|
resource: rule,
|
|
69
73
|
resourceType: "rule",
|
|
70
74
|
searchSubscription,
|
|
71
75
|
subscriptionUpdating,
|
|
76
|
+
createSubscription,
|
|
77
|
+
updateSubscription,
|
|
78
|
+
deleteSubscription,
|
|
72
79
|
};
|
|
73
80
|
|
|
74
81
|
it("matches the latest snapshot", async () => {
|
|
@@ -76,4 +83,23 @@ describe("<Subscription />", () => {
|
|
|
76
83
|
await waitForLoad(rendered);
|
|
77
84
|
expect(rendered.container).toMatchSnapshot();
|
|
78
85
|
});
|
|
86
|
+
|
|
87
|
+
it("closes the popup after saving the subscription", async () => {
|
|
88
|
+
const rendered = render(<Subscription {...props} />);
|
|
89
|
+
await waitForLoad(rendered);
|
|
90
|
+
|
|
91
|
+
const user = userEvent.setup({ delay: null });
|
|
92
|
+
|
|
93
|
+
// abre el popup haciendo click en el botón de suscripción
|
|
94
|
+
await user.click(rendered.getByRole("button"));
|
|
95
|
+
|
|
96
|
+
// click en guardar
|
|
97
|
+
const saveButton = await rendered.findByText(/actions.save/i);
|
|
98
|
+
await user.click(saveButton);
|
|
99
|
+
|
|
100
|
+
// el popup se cierra (contenido ya no está en el DOM)
|
|
101
|
+
await waitFor(() =>
|
|
102
|
+
expect(rendered.queryByText(/actions.save/i)).not.toBeInTheDocument()
|
|
103
|
+
);
|
|
104
|
+
});
|
|
79
105
|
});
|