@griddo/ax 12.4.0 → 12.5.0
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/config/webpack.config.js +5 -0
- package/package.json +2 -2
- package/src/__tests__/components/ConfigPanel/Form/Form.test.tsx +47 -57
- package/src/__tests__/components/ConfigPanel/Header/Header.test.tsx +46 -42
- package/src/__tests__/components/ElementsTooltip/ElementsTooltip.test.tsx +6 -17
- package/src/__tests__/components/EmptyState/EmptyState.test.tsx +9 -9
- package/src/__tests__/components/Fields/AsyncSelect/AsyncSelect.test.tsx +60 -50
- package/src/__tests__/components/Fields/ColorPicker/ColorPicker.test.tsx +66 -58
- package/src/__tests__/components/Fields/ComponentContainer/ComponentContainer.test.tsx +222 -425
- package/src/__tests__/components/Fields/FileField/FileField.test.tsx +13 -14
- package/src/__tests__/components/Fields/ImageField/ImageField.test.tsx +275 -259
- package/src/__tests__/components/Fields/IntegrationsField/IntegrationsField.test.tsx +50 -48
- package/src/__tests__/components/Fields/NoteField/NoteField.test.tsx +9 -8
- package/src/__tests__/components/Fields/NumberField/NumberField.test.tsx +8 -12
- package/src/__tests__/components/Fields/TextArea/TextArea.test.tsx +6 -2
- package/src/__tests__/components/Fields/ToggleField/ToggleField.test.tsx +15 -23
- package/src/__tests__/components/Fields/Tooltip/Tooltip.test.tsx +8 -2
- package/src/__tests__/components/Fields/VisualUniqueSelection/VisualUniqueSelection.test.tsx +29 -21
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.config.test.tsx +103 -0
- package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +7 -2
- package/src/__tests__/components/ResizePanel/ResizePanel.test.tsx +8 -6
- package/src/__tests__/components/SideModal/SideModal.test.tsx +150 -104
- package/src/__tests__/components/TableFilters/LiveFilter/LiveFilter.test.tsx +15 -29
- package/src/__tests__/components/TableFilters/StatusFilter/StatusFilter.test.tsx +61 -36
- package/src/__tests__/components/Tabs/Tabs.test.tsx +65 -61
- package/src/__tests__/components/Toast/Toast.test.tsx +19 -21
- package/src/__tests__/modules/FramePreview/FramePreview.test.tsx +16 -0
- package/src/__tests__/modules/Sites/SitesList/ListView/BulkHeader/BulkHeader.test.tsx +24 -19
- package/src/__tests__/modules/Sites/SitesList/SitesList.test.tsx +15 -6
- package/src/__tests__/modules/Users/Roles/BulkHeader/BulkHeader.test.tsx +69 -64
- package/src/__tests__/modules/Users/Roles/Roles.test.tsx +7 -4
- package/src/components/Fields/Wysiwyg/config.tsx +68 -17
- package/src/components/Fields/Wysiwyg/helpers.tsx +2 -0
- package/src/components/Fields/Wysiwyg/index.tsx +41 -10
- package/src/components/ResizePanel/index.tsx +7 -2
|
@@ -31,7 +31,11 @@ const data = {
|
|
|
31
31
|
|
|
32
32
|
mockedAxios.mockResolvedValue(data);
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// Props por test. Antes era un `mock<IImageFieldProps>()` compartido sin nada
|
|
35
|
+
// puesto: el primer test renderizaba con el proxy virgen (el spread de JSX no
|
|
36
|
+
// pasa ninguna prop hasta que alguien las toca) y los demás se lo iban llenando.
|
|
37
|
+
const makeProps = (overrides: Partial<IImageFieldProps> = {}): IImageFieldProps =>
|
|
38
|
+
Object.assign(mock<IImageFieldProps>(), overrides);
|
|
35
39
|
|
|
36
40
|
const initialStore = {
|
|
37
41
|
...defaultStore,
|
|
@@ -67,7 +71,7 @@ describe("ImageField component rendering", () => {
|
|
|
67
71
|
it("should render the component", () => {
|
|
68
72
|
render(
|
|
69
73
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
70
|
-
<ImageField {...
|
|
74
|
+
<ImageField {...makeProps()} />
|
|
71
75
|
</ThemeProvider>,
|
|
72
76
|
{ store },
|
|
73
77
|
);
|
|
@@ -77,59 +81,59 @@ describe("ImageField component rendering", () => {
|
|
|
77
81
|
});
|
|
78
82
|
|
|
79
83
|
it("should render the component with linkableImage", () => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
description: "",
|
|
85
|
-
alt: "",
|
|
86
|
-
tags: [],
|
|
87
|
-
url: "kjkajsf",
|
|
88
|
-
thumb: "jasd",
|
|
89
|
-
publicId: "thesaurus",
|
|
90
|
-
damId: "screenshot",
|
|
91
|
-
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
92
|
-
size: 1123589,
|
|
93
|
-
width: 1444,
|
|
94
|
-
height: 640,
|
|
95
|
-
orientation: "L",
|
|
96
|
-
site: null,
|
|
97
|
-
folderId: null,
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
defaultProps.selectedContent = {
|
|
101
|
-
component: "LinkableImage",
|
|
102
|
-
editorID: 7,
|
|
103
|
-
parentEditorID: 4,
|
|
104
|
-
title: "",
|
|
105
|
-
alt: "",
|
|
106
|
-
veil: 0,
|
|
107
|
-
file: {
|
|
108
|
-
id: 1001,
|
|
109
|
-
name: "Imagen_Interior_fullstack.png",
|
|
84
|
+
const props = makeProps({
|
|
85
|
+
value: {
|
|
86
|
+
id: 857,
|
|
87
|
+
name: ".png",
|
|
110
88
|
title: "",
|
|
111
89
|
description: "",
|
|
112
90
|
alt: "",
|
|
113
91
|
tags: [],
|
|
114
|
-
url: "
|
|
115
|
-
thumb: "
|
|
116
|
-
publicId: "thesaurus
|
|
117
|
-
damId: "
|
|
118
|
-
published: "2022-
|
|
119
|
-
size:
|
|
120
|
-
width:
|
|
121
|
-
height:
|
|
92
|
+
url: "kjkajsf",
|
|
93
|
+
thumb: "jasd",
|
|
94
|
+
publicId: "thesaurus",
|
|
95
|
+
damId: "screenshot",
|
|
96
|
+
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
97
|
+
size: 1123589,
|
|
98
|
+
width: 1444,
|
|
99
|
+
height: 640,
|
|
122
100
|
orientation: "L",
|
|
123
|
-
site:
|
|
101
|
+
site: null,
|
|
124
102
|
folderId: null,
|
|
125
103
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
104
|
+
selectedContent: {
|
|
105
|
+
component: "LinkableImage",
|
|
106
|
+
editorID: 7,
|
|
107
|
+
parentEditorID: 4,
|
|
108
|
+
title: "",
|
|
109
|
+
alt: "",
|
|
110
|
+
veil: 0,
|
|
111
|
+
file: {
|
|
112
|
+
id: 1001,
|
|
113
|
+
name: "Imagen_Interior_fullstack.png",
|
|
114
|
+
title: "",
|
|
115
|
+
description: "",
|
|
116
|
+
alt: "",
|
|
117
|
+
tags: [],
|
|
118
|
+
url: "https://images.dev.griddo.io/imagen-interior-fullstack",
|
|
119
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/imagen-interior-fullstack",
|
|
120
|
+
publicId: "thesaurus-dev/Imagen_Interior_fullstack_6c908d9f-b493-4c93-b4d2-a0439bc00820",
|
|
121
|
+
damId: "imagen-interior-fullstack",
|
|
122
|
+
published: "2022-06-30T07:06:54.352Z",
|
|
123
|
+
size: 55286,
|
|
124
|
+
width: 680,
|
|
125
|
+
height: 353,
|
|
126
|
+
orientation: "L",
|
|
127
|
+
site: 113,
|
|
128
|
+
folderId: null,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
cropPreview: true,
|
|
132
|
+
});
|
|
129
133
|
|
|
130
134
|
render(
|
|
131
135
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
132
|
-
<ImageField {...
|
|
136
|
+
<ImageField {...props} />
|
|
133
137
|
</ThemeProvider>,
|
|
134
138
|
{ store },
|
|
135
139
|
);
|
|
@@ -140,40 +144,41 @@ describe("ImageField component rendering", () => {
|
|
|
140
144
|
});
|
|
141
145
|
|
|
142
146
|
it("should render the component with image with no url attr", async () => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
title: "",
|
|
150
|
-
alt: "",
|
|
151
|
-
veil: 0,
|
|
152
|
-
file: {
|
|
153
|
-
id: 1001,
|
|
154
|
-
name: "Imagen_Interior_fullstack.png",
|
|
147
|
+
const props = makeProps({
|
|
148
|
+
value: "image.png",
|
|
149
|
+
selectedContent: {
|
|
150
|
+
component: "LinkableImage",
|
|
151
|
+
editorID: 7,
|
|
152
|
+
parentEditorID: 4,
|
|
155
153
|
title: "",
|
|
156
|
-
description: "",
|
|
157
154
|
alt: "",
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
155
|
+
veil: 0,
|
|
156
|
+
file: {
|
|
157
|
+
id: 1001,
|
|
158
|
+
name: "Imagen_Interior_fullstack.png",
|
|
159
|
+
title: "",
|
|
160
|
+
description: "",
|
|
161
|
+
alt: "",
|
|
162
|
+
tags: [],
|
|
163
|
+
url: "https://images.dev.griddo.io/imagen-interior-fullstack",
|
|
164
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/imagen-interior-fullstack",
|
|
165
|
+
publicId: "thesaurus-dev/Imagen_Interior_fullstack_6c908d9f-b493-4c93-b4d2-a0439bc00820",
|
|
166
|
+
damId: "imagen-interior-fullstack",
|
|
167
|
+
published: "2022-06-30T07:06:54.352Z",
|
|
168
|
+
size: 55286,
|
|
169
|
+
width: 680,
|
|
170
|
+
height: 353,
|
|
171
|
+
orientation: "L",
|
|
172
|
+
site: 113,
|
|
173
|
+
folderId: null,
|
|
174
|
+
},
|
|
170
175
|
},
|
|
171
|
-
};
|
|
176
|
+
});
|
|
172
177
|
|
|
173
178
|
await act(async () =>
|
|
174
179
|
render(
|
|
175
180
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
176
|
-
<ImageField {...
|
|
181
|
+
<ImageField {...props} />
|
|
177
182
|
</ThemeProvider>,
|
|
178
183
|
{ store },
|
|
179
184
|
),
|
|
@@ -185,40 +190,41 @@ describe("ImageField component rendering", () => {
|
|
|
185
190
|
});
|
|
186
191
|
|
|
187
192
|
it("should render the component with no image", async () => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
title: "",
|
|
195
|
-
alt: "",
|
|
196
|
-
veil: 0,
|
|
197
|
-
file: {
|
|
198
|
-
id: 1001,
|
|
199
|
-
name: "Imagen_Interior_fullstack.png",
|
|
193
|
+
const props = makeProps({
|
|
194
|
+
value: null,
|
|
195
|
+
selectedContent: {
|
|
196
|
+
component: "LinkableImage",
|
|
197
|
+
editorID: 7,
|
|
198
|
+
parentEditorID: 4,
|
|
200
199
|
title: "",
|
|
201
|
-
description: "",
|
|
202
200
|
alt: "",
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
201
|
+
veil: 0,
|
|
202
|
+
file: {
|
|
203
|
+
id: 1001,
|
|
204
|
+
name: "Imagen_Interior_fullstack.png",
|
|
205
|
+
title: "",
|
|
206
|
+
description: "",
|
|
207
|
+
alt: "",
|
|
208
|
+
tags: [],
|
|
209
|
+
url: "https://images.dev.griddo.io/imagen-interior-fullstack",
|
|
210
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/imagen-interior-fullstack",
|
|
211
|
+
publicId: "thesaurus-dev/Imagen_Interior_fullstack_6c908d9f-b493-4c93-b4d2-a0439bc00820",
|
|
212
|
+
damId: "imagen-interior-fullstack",
|
|
213
|
+
published: "2022-06-30T07:06:54.352Z",
|
|
214
|
+
size: 55286,
|
|
215
|
+
width: 680,
|
|
216
|
+
height: 353,
|
|
217
|
+
orientation: "L",
|
|
218
|
+
site: 113,
|
|
219
|
+
folderId: null,
|
|
220
|
+
},
|
|
215
221
|
},
|
|
216
|
-
};
|
|
222
|
+
});
|
|
217
223
|
|
|
218
224
|
await act(async () =>
|
|
219
225
|
render(
|
|
220
226
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
221
|
-
<ImageField {...
|
|
227
|
+
<ImageField {...props} />
|
|
222
228
|
</ThemeProvider>,
|
|
223
229
|
{ store },
|
|
224
230
|
),
|
|
@@ -230,42 +236,44 @@ describe("ImageField component rendering", () => {
|
|
|
230
236
|
});
|
|
231
237
|
|
|
232
238
|
it("should render the component with image with undefined", async () => {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
editorID: 7,
|
|
240
|
-
parentEditorID: 4,
|
|
241
|
-
title: "",
|
|
242
|
-
alt: "",
|
|
243
|
-
veil: 0,
|
|
244
|
-
file: {
|
|
245
|
-
id: 1001,
|
|
246
|
-
name: "Imagen_Interior_fullstack.png",
|
|
239
|
+
const props = makeProps({
|
|
240
|
+
value: undefined,
|
|
241
|
+
selectedContent: {
|
|
242
|
+
component: "LinkableImage",
|
|
243
|
+
editorID: 7,
|
|
244
|
+
parentEditorID: 4,
|
|
247
245
|
title: "",
|
|
248
|
-
description: "",
|
|
249
246
|
alt: "",
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
247
|
+
veil: 0,
|
|
248
|
+
file: {
|
|
249
|
+
id: 1001,
|
|
250
|
+
name: "Imagen_Interior_fullstack.png",
|
|
251
|
+
title: "",
|
|
252
|
+
description: "",
|
|
253
|
+
alt: "",
|
|
254
|
+
tags: [],
|
|
255
|
+
url: "https://images.dev.griddo.io/imagen-interior-fullstack",
|
|
256
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/imagen-interior-fullstack",
|
|
257
|
+
publicId: "thesaurus-dev/Imagen_Interior_fullstack_6c908d9f-b493-4c93-b4d2-a0439bc00820",
|
|
258
|
+
damId: "imagen-interior-fullstack",
|
|
259
|
+
published: "2022-06-30T07:06:54.352Z",
|
|
260
|
+
size: 55286,
|
|
261
|
+
width: 680,
|
|
262
|
+
height: 353,
|
|
263
|
+
orientation: "L",
|
|
264
|
+
site: 113,
|
|
265
|
+
folderId: null,
|
|
266
|
+
},
|
|
262
267
|
},
|
|
263
|
-
};
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// biome-ignore lint/suspicious/noTsIgnore: TODO: fix this
|
|
271
|
+
// @ts-ignore
|
|
264
272
|
|
|
265
273
|
await act(async () =>
|
|
266
274
|
render(
|
|
267
275
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
268
|
-
<ImageField {...
|
|
276
|
+
<ImageField {...props} />
|
|
269
277
|
</ThemeProvider>,
|
|
270
278
|
{ store },
|
|
271
279
|
),
|
|
@@ -279,59 +287,61 @@ describe("ImageField component rendering", () => {
|
|
|
279
287
|
|
|
280
288
|
describe("ImageField triggers", () => {
|
|
281
289
|
it("should handle the onClick", async () => {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
tags: [],
|
|
289
|
-
url: "https://images.dev.griddo.io/screenshot-2022-04-13-at-164915",
|
|
290
|
-
thumb: "https://images.dev.griddo.io/w/215/h/161/screenshot-2022-04-13-at-164915",
|
|
291
|
-
publicId: "thesaurus-dev/Screenshot_2022-04-13_at_16.49.15_927293bf-d163-402f-b216-4dc8656ea8c1",
|
|
292
|
-
damId: "screenshot-2022-04-13-at-164915",
|
|
293
|
-
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
294
|
-
size: 1123589,
|
|
295
|
-
width: 1444,
|
|
296
|
-
height: 640,
|
|
297
|
-
orientation: "L",
|
|
298
|
-
site: null,
|
|
299
|
-
folderId: null,
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
defaultProps.selectedContent = {
|
|
303
|
-
component: "LinkableImage",
|
|
304
|
-
editorID: 7,
|
|
305
|
-
parentEditorID: 4,
|
|
306
|
-
title: "",
|
|
307
|
-
alt: "",
|
|
308
|
-
veil: 0,
|
|
309
|
-
file: {
|
|
310
|
-
id: 1001,
|
|
311
|
-
name: "Imagen_Interior_fullstack.png",
|
|
290
|
+
const setIsGalleryMock = vi.fn();
|
|
291
|
+
const props = makeProps({
|
|
292
|
+
setIsGalleryOpened: setIsGalleryMock,
|
|
293
|
+
value: {
|
|
294
|
+
id: 857,
|
|
295
|
+
name: ".png",
|
|
312
296
|
title: "",
|
|
313
297
|
description: "",
|
|
314
298
|
alt: "",
|
|
315
299
|
tags: [],
|
|
316
|
-
url: "https://images.dev.griddo.io/
|
|
317
|
-
thumb: "https://images.dev.griddo.io/w/215/h/161/
|
|
318
|
-
publicId: "thesaurus-dev/
|
|
319
|
-
damId: "
|
|
320
|
-
published: "2022-
|
|
321
|
-
size:
|
|
322
|
-
width:
|
|
323
|
-
height:
|
|
300
|
+
url: "https://images.dev.griddo.io/screenshot-2022-04-13-at-164915",
|
|
301
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/screenshot-2022-04-13-at-164915",
|
|
302
|
+
publicId: "thesaurus-dev/Screenshot_2022-04-13_at_16.49.15_927293bf-d163-402f-b216-4dc8656ea8c1",
|
|
303
|
+
damId: "screenshot-2022-04-13-at-164915",
|
|
304
|
+
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
305
|
+
size: 1123589,
|
|
306
|
+
width: 1444,
|
|
307
|
+
height: 640,
|
|
324
308
|
orientation: "L",
|
|
325
|
-
site:
|
|
309
|
+
site: null,
|
|
326
310
|
folderId: null,
|
|
327
311
|
},
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
312
|
+
selectedContent: {
|
|
313
|
+
component: "LinkableImage",
|
|
314
|
+
editorID: 7,
|
|
315
|
+
parentEditorID: 4,
|
|
316
|
+
title: "",
|
|
317
|
+
alt: "",
|
|
318
|
+
veil: 0,
|
|
319
|
+
file: {
|
|
320
|
+
id: 1001,
|
|
321
|
+
name: "Imagen_Interior_fullstack.png",
|
|
322
|
+
title: "",
|
|
323
|
+
description: "",
|
|
324
|
+
alt: "",
|
|
325
|
+
tags: [],
|
|
326
|
+
url: "https://images.dev.griddo.io/imagen-interior-fullstack",
|
|
327
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/imagen-interior-fullstack",
|
|
328
|
+
publicId: "thesaurus-dev/Imagen_Interior_fullstack_6c908d9f-b493-4c93-b4d2-a0439bc00820",
|
|
329
|
+
damId: "imagen-interior-fullstack",
|
|
330
|
+
published: "2022-06-30T07:06:54.352Z",
|
|
331
|
+
size: 55286,
|
|
332
|
+
width: 680,
|
|
333
|
+
height: 353,
|
|
334
|
+
orientation: "L",
|
|
335
|
+
site: 113,
|
|
336
|
+
folderId: null,
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
disabled: false,
|
|
340
|
+
});
|
|
331
341
|
|
|
332
342
|
render(
|
|
333
343
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
334
|
-
<ImageField {...
|
|
344
|
+
<ImageField {...props} />
|
|
335
345
|
</ThemeProvider>,
|
|
336
346
|
{ store },
|
|
337
347
|
);
|
|
@@ -345,58 +355,61 @@ describe("ImageField triggers", () => {
|
|
|
345
355
|
});
|
|
346
356
|
|
|
347
357
|
it("should handle the delete action", () => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
tags: [],
|
|
355
|
-
url: "https://images.dev.griddo.io/screenshot-2022-04-13-at-164915",
|
|
356
|
-
thumb: "https://images.dev.griddo.io/w/215/h/161/screenshot-2022-04-13-at-164915",
|
|
357
|
-
publicId: "thesaurus-dev/Screenshot_2022-04-13_at_16.49.15_927293bf-d163-402f-b216-4dc8656ea8c1",
|
|
358
|
-
damId: "screenshot-2022-04-13-at-164915",
|
|
359
|
-
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
360
|
-
size: 1123589,
|
|
361
|
-
width: 1444,
|
|
362
|
-
height: 640,
|
|
363
|
-
orientation: "L",
|
|
364
|
-
site: null,
|
|
365
|
-
folderId: null,
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
defaultProps.selectedContent = {
|
|
369
|
-
component: "LinkableImage",
|
|
370
|
-
editorID: 7,
|
|
371
|
-
parentEditorID: 4,
|
|
372
|
-
title: "",
|
|
373
|
-
alt: "",
|
|
374
|
-
veil: 0,
|
|
375
|
-
file: {
|
|
376
|
-
id: 1001,
|
|
377
|
-
name: "Imagen_Interior_fullstack.png",
|
|
358
|
+
const onChangeMock = vi.fn();
|
|
359
|
+
const props = makeProps({
|
|
360
|
+
onChange: onChangeMock,
|
|
361
|
+
value: {
|
|
362
|
+
id: 857,
|
|
363
|
+
name: ".png",
|
|
378
364
|
title: "",
|
|
379
365
|
description: "",
|
|
380
366
|
alt: "",
|
|
381
367
|
tags: [],
|
|
382
|
-
url: "https://images.dev.griddo.io/
|
|
383
|
-
thumb: "https://images.dev.griddo.io/w/215/h/161/
|
|
384
|
-
publicId: "thesaurus-dev/
|
|
385
|
-
damId: "
|
|
386
|
-
published: "2022-
|
|
387
|
-
size:
|
|
388
|
-
width:
|
|
389
|
-
height:
|
|
368
|
+
url: "https://images.dev.griddo.io/screenshot-2022-04-13-at-164915",
|
|
369
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/screenshot-2022-04-13-at-164915",
|
|
370
|
+
publicId: "thesaurus-dev/Screenshot_2022-04-13_at_16.49.15_927293bf-d163-402f-b216-4dc8656ea8c1",
|
|
371
|
+
damId: "screenshot-2022-04-13-at-164915",
|
|
372
|
+
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
373
|
+
size: 1123589,
|
|
374
|
+
width: 1444,
|
|
375
|
+
height: 640,
|
|
390
376
|
orientation: "L",
|
|
391
|
-
site:
|
|
377
|
+
site: null,
|
|
392
378
|
folderId: null,
|
|
393
379
|
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
380
|
+
selectedContent: {
|
|
381
|
+
component: "LinkableImage",
|
|
382
|
+
editorID: 7,
|
|
383
|
+
parentEditorID: 4,
|
|
384
|
+
title: "",
|
|
385
|
+
alt: "",
|
|
386
|
+
veil: 0,
|
|
387
|
+
file: {
|
|
388
|
+
id: 1001,
|
|
389
|
+
name: "Imagen_Interior_fullstack.png",
|
|
390
|
+
title: "",
|
|
391
|
+
description: "",
|
|
392
|
+
alt: "",
|
|
393
|
+
tags: [],
|
|
394
|
+
url: "https://images.dev.griddo.io/imagen-interior-fullstack",
|
|
395
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/imagen-interior-fullstack",
|
|
396
|
+
publicId: "thesaurus-dev/Imagen_Interior_fullstack_6c908d9f-b493-4c93-b4d2-a0439bc00820",
|
|
397
|
+
damId: "imagen-interior-fullstack",
|
|
398
|
+
published: "2022-06-30T07:06:54.352Z",
|
|
399
|
+
size: 55286,
|
|
400
|
+
width: 680,
|
|
401
|
+
height: 353,
|
|
402
|
+
orientation: "L",
|
|
403
|
+
site: 113,
|
|
404
|
+
folderId: null,
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
disabled: false,
|
|
408
|
+
});
|
|
409
|
+
|
|
397
410
|
const { rerender } = render(
|
|
398
411
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
399
|
-
<ImageField {...
|
|
412
|
+
<ImageField {...props} />
|
|
400
413
|
</ThemeProvider>,
|
|
401
414
|
{ store },
|
|
402
415
|
);
|
|
@@ -409,7 +422,7 @@ describe("ImageField triggers", () => {
|
|
|
409
422
|
|
|
410
423
|
rerender(
|
|
411
424
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
412
|
-
<ImageField {...
|
|
425
|
+
<ImageField {...props} />
|
|
413
426
|
</ThemeProvider>,
|
|
414
427
|
);
|
|
415
428
|
const fieldWrapperAction = screen.getByTestId("fieldWrapper");
|
|
@@ -419,58 +432,61 @@ describe("ImageField triggers", () => {
|
|
|
419
432
|
});
|
|
420
433
|
|
|
421
434
|
it("should handle the change action", async () => {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
tags: [],
|
|
429
|
-
url: "https://images.dev.griddo.io/screenshot-2022-04-13-at-164915",
|
|
430
|
-
thumb: "https://images.dev.griddo.io/w/215/h/161/screenshot-2022-04-13-at-164915",
|
|
431
|
-
publicId: "thesaurus-dev/Screenshot_2022-04-13_at_16.49.15_927293bf-d163-402f-b216-4dc8656ea8c1",
|
|
432
|
-
damId: "screenshot-2022-04-13-at-164915",
|
|
433
|
-
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
434
|
-
size: 1123589,
|
|
435
|
-
width: 1444,
|
|
436
|
-
height: 640,
|
|
437
|
-
orientation: "L",
|
|
438
|
-
site: null,
|
|
439
|
-
folderId: null,
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
defaultProps.selectedContent = {
|
|
443
|
-
component: "LinkableImage",
|
|
444
|
-
editorID: 7,
|
|
445
|
-
parentEditorID: 4,
|
|
446
|
-
title: "",
|
|
447
|
-
alt: "",
|
|
448
|
-
veil: 0,
|
|
449
|
-
file: {
|
|
450
|
-
id: 1001,
|
|
451
|
-
name: "Imagen_Interior_fullstack.png",
|
|
435
|
+
const setIsGalleryMock = vi.fn();
|
|
436
|
+
const props = makeProps({
|
|
437
|
+
setIsGalleryOpened: setIsGalleryMock,
|
|
438
|
+
value: {
|
|
439
|
+
id: 857,
|
|
440
|
+
name: ".png",
|
|
452
441
|
title: "",
|
|
453
442
|
description: "",
|
|
454
443
|
alt: "",
|
|
455
444
|
tags: [],
|
|
456
|
-
url: "https://images.dev.griddo.io/
|
|
457
|
-
thumb: "https://images.dev.griddo.io/w/215/h/161/
|
|
458
|
-
publicId: "thesaurus-dev/
|
|
459
|
-
damId: "
|
|
460
|
-
published: "2022-
|
|
461
|
-
size:
|
|
462
|
-
width:
|
|
463
|
-
height:
|
|
445
|
+
url: "https://images.dev.griddo.io/screenshot-2022-04-13-at-164915",
|
|
446
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/screenshot-2022-04-13-at-164915",
|
|
447
|
+
publicId: "thesaurus-dev/Screenshot_2022-04-13_at_16.49.15_927293bf-d163-402f-b216-4dc8656ea8c1",
|
|
448
|
+
damId: "screenshot-2022-04-13-at-164915",
|
|
449
|
+
published: new Date("2022-04-18T08:52:48.334Z"),
|
|
450
|
+
size: 1123589,
|
|
451
|
+
width: 1444,
|
|
452
|
+
height: 640,
|
|
464
453
|
orientation: "L",
|
|
465
|
-
site:
|
|
454
|
+
site: null,
|
|
466
455
|
folderId: null,
|
|
467
456
|
},
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
457
|
+
selectedContent: {
|
|
458
|
+
component: "LinkableImage",
|
|
459
|
+
editorID: 7,
|
|
460
|
+
parentEditorID: 4,
|
|
461
|
+
title: "",
|
|
462
|
+
alt: "",
|
|
463
|
+
veil: 0,
|
|
464
|
+
file: {
|
|
465
|
+
id: 1001,
|
|
466
|
+
name: "Imagen_Interior_fullstack.png",
|
|
467
|
+
title: "",
|
|
468
|
+
description: "",
|
|
469
|
+
alt: "",
|
|
470
|
+
tags: [],
|
|
471
|
+
url: "https://images.dev.griddo.io/imagen-interior-fullstack",
|
|
472
|
+
thumb: "https://images.dev.griddo.io/w/215/h/161/imagen-interior-fullstack",
|
|
473
|
+
publicId: "thesaurus-dev/Imagen_Interior_fullstack_6c908d9f-b493-4c93-b4d2-a0439bc00820",
|
|
474
|
+
damId: "imagen-interior-fullstack",
|
|
475
|
+
published: "2022-06-30T07:06:54.352Z",
|
|
476
|
+
size: 55286,
|
|
477
|
+
width: 680,
|
|
478
|
+
height: 353,
|
|
479
|
+
orientation: "L",
|
|
480
|
+
site: 113,
|
|
481
|
+
folderId: null,
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
disabled: false,
|
|
485
|
+
});
|
|
486
|
+
|
|
471
487
|
const { rerender } = render(
|
|
472
488
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
473
|
-
<ImageField {...
|
|
489
|
+
<ImageField {...props} />
|
|
474
490
|
</ThemeProvider>,
|
|
475
491
|
{ store },
|
|
476
492
|
);
|
|
@@ -483,7 +499,7 @@ describe("ImageField triggers", () => {
|
|
|
483
499
|
|
|
484
500
|
rerender(
|
|
485
501
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
486
|
-
<ImageField {...
|
|
502
|
+
<ImageField {...props} />
|
|
487
503
|
</ThemeProvider>,
|
|
488
504
|
);
|
|
489
505
|
|