@contentful/field-editor-slug 1.3.0 → 1.3.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/dist/cjs/SlugEditor.test.js +161 -142
- package/dist/esm/SlugEditor.test.js +162 -138
- package/package.json +4 -5
|
@@ -5,14 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
const _react = _interop_require_wildcard(require("react"));
|
|
6
6
|
const _fieldeditortestutils = require("@contentful/field-editor-test-utils");
|
|
7
7
|
const _react1 = require("@testing-library/react");
|
|
8
|
-
const _identity = _interop_require_default(require("lodash/identity"));
|
|
9
8
|
require("@testing-library/jest-dom/extend-expect");
|
|
10
9
|
const _SlugEditor = require("./SlugEditor");
|
|
11
|
-
function _interop_require_default(obj) {
|
|
12
|
-
return obj && obj.__esModule ? obj : {
|
|
13
|
-
default: obj
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
10
|
function _getRequireWildcardCache(nodeInterop) {
|
|
17
11
|
if (typeof WeakMap !== "function") return null;
|
|
18
12
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -55,11 +49,6 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
55
49
|
(0, _react1.configure)({
|
|
56
50
|
testIdAttribute: 'data-test-id'
|
|
57
51
|
});
|
|
58
|
-
jest.mock('lodash/throttle', ()=>({
|
|
59
|
-
default: _identity.default
|
|
60
|
-
}), {
|
|
61
|
-
virtual: true
|
|
62
|
-
});
|
|
63
52
|
jest.mock('use-debounce', ()=>({
|
|
64
53
|
useDebounce: (text)=>[
|
|
65
54
|
text
|
|
@@ -135,12 +124,13 @@ describe('SlugEditor', ()=>{
|
|
|
135
124
|
baseSdk: sdk,
|
|
136
125
|
isInitiallyDisabled: false
|
|
137
126
|
}));
|
|
138
|
-
await (0, _react1.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
await (0, _react1.waitFor)(()=>{
|
|
128
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
129
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
130
|
+
expect(sdk.space.getEntries).not.toHaveBeenCalled();
|
|
131
|
+
expect(sdk.entry.fields['title-id'].getValue).toHaveBeenCalledTimes(1);
|
|
132
|
+
expect(sdk.entry.getSys).toHaveBeenCalledTimes(2);
|
|
133
|
+
});
|
|
144
134
|
});
|
|
145
135
|
it('when title and slug are the same field', async ()=>{
|
|
146
136
|
const { field , titleField , sdk } = createMocks();
|
|
@@ -150,9 +140,10 @@ describe('SlugEditor', ()=>{
|
|
|
150
140
|
baseSdk: sdk,
|
|
151
141
|
isInitiallyDisabled: false
|
|
152
142
|
}));
|
|
153
|
-
await (0, _react1.
|
|
154
|
-
|
|
155
|
-
|
|
143
|
+
await (0, _react1.waitFor)(()=>{
|
|
144
|
+
expect(titleField.onValueChanged).not.toHaveBeenCalled();
|
|
145
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
146
|
+
});
|
|
156
147
|
});
|
|
157
148
|
it('when a saved slug is different from a title at the render', async ()=>{
|
|
158
149
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -164,9 +155,10 @@ describe('SlugEditor', ()=>{
|
|
|
164
155
|
baseSdk: sdk,
|
|
165
156
|
isInitiallyDisabled: false
|
|
166
157
|
}));
|
|
167
|
-
await (0, _react1.
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
await (0, _react1.waitFor)(()=>{
|
|
159
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
160
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
161
|
+
});
|
|
170
162
|
});
|
|
171
163
|
});
|
|
172
164
|
describe('should check for uniqueness', ()=>{
|
|
@@ -192,18 +184,19 @@ describe('SlugEditor', ()=>{
|
|
|
192
184
|
baseSdk: sdk,
|
|
193
185
|
isInitiallyDisabled: false
|
|
194
186
|
}));
|
|
195
|
-
await (0, _react1.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
187
|
+
await (0, _react1.waitFor)(()=>{
|
|
188
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
189
|
+
expect(sdk.space.getEntries).toHaveBeenLastCalledWith({
|
|
190
|
+
content_type: 'content-type-id',
|
|
191
|
+
'fields.slug-id.en-US': 'slug-value',
|
|
192
|
+
limit: 0,
|
|
193
|
+
'sys.id[ne]': 'entry-id',
|
|
194
|
+
'sys.publishedAt[exists]': true
|
|
195
|
+
});
|
|
196
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(1);
|
|
197
|
+
expect(queryByTestId('slug-editor-spinner')).not.toBeInTheDocument();
|
|
198
|
+
expect(queryByText('This slug has already been published in another entry')).not.toBeInTheDocument();
|
|
199
|
+
});
|
|
207
200
|
});
|
|
208
201
|
it('if it is not published', async ()=>{
|
|
209
202
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -227,19 +220,20 @@ describe('SlugEditor', ()=>{
|
|
|
227
220
|
baseSdk: sdk,
|
|
228
221
|
isInitiallyDisabled: false
|
|
229
222
|
}));
|
|
230
|
-
await (0, _react1.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
223
|
+
await (0, _react1.waitFor)(()=>{
|
|
224
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
225
|
+
expect(sdk.space.getEntries).toHaveBeenLastCalledWith({
|
|
226
|
+
content_type: 'content-type-id',
|
|
227
|
+
'fields.slug-id.en-US': 'slug-value',
|
|
228
|
+
limit: 0,
|
|
229
|
+
'sys.id[ne]': 'entry-id',
|
|
230
|
+
'sys.publishedAt[exists]': true
|
|
231
|
+
});
|
|
232
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(1);
|
|
233
|
+
expect(queryByTestId('slug-editor-spinner')).not.toBeInTheDocument();
|
|
234
|
+
expect(queryByText('This slug has already been published in another entry')).toBeInTheDocument();
|
|
235
|
+
expect(getByTestId('cf-ui-text-input')).toHaveValue('slug-value');
|
|
236
|
+
});
|
|
243
237
|
sdk.space.getEntries.mockResolvedValue({
|
|
244
238
|
total: 0
|
|
245
239
|
});
|
|
@@ -248,18 +242,19 @@ describe('SlugEditor', ()=>{
|
|
|
248
242
|
value: '123'
|
|
249
243
|
}
|
|
250
244
|
});
|
|
251
|
-
await (0, _react1.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
245
|
+
await (0, _react1.waitFor)(()=>{
|
|
246
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
247
|
+
expect(field.setValue).toHaveBeenCalledWith('123');
|
|
248
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
249
|
+
expect(sdk.space.getEntries).toHaveBeenLastCalledWith({
|
|
250
|
+
content_type: 'content-type-id',
|
|
251
|
+
'fields.slug-id.en-US': '123',
|
|
252
|
+
limit: 0,
|
|
253
|
+
'sys.id[ne]': 'entry-id',
|
|
254
|
+
'sys.publishedAt[exists]': true
|
|
255
|
+
});
|
|
256
|
+
expect(queryByText('This slug has already been published in another entry')).not.toBeInTheDocument();
|
|
257
|
+
});
|
|
263
258
|
});
|
|
264
259
|
});
|
|
265
260
|
describe('should react to title changes', ()=>{
|
|
@@ -273,12 +268,13 @@ describe('SlugEditor', ()=>{
|
|
|
273
268
|
baseSdk: sdk,
|
|
274
269
|
isInitiallyDisabled: true
|
|
275
270
|
}));
|
|
276
|
-
await (0, _react1.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
271
|
+
await (0, _react1.waitFor)(()=>{
|
|
272
|
+
expect(field.setValue).toHaveBeenCalled();
|
|
273
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
274
|
+
expect(sdk.space.getEntries).toHaveBeenCalled();
|
|
275
|
+
expect(sdk.entry.fields['title-id'].getValue).toHaveBeenCalledTimes(1);
|
|
276
|
+
expect(sdk.entry.getSys).toHaveBeenCalledTimes(2);
|
|
277
|
+
});
|
|
282
278
|
});
|
|
283
279
|
it('should generate unique value with date if title is empty', async ()=>{
|
|
284
280
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -290,20 +286,23 @@ describe('SlugEditor', ()=>{
|
|
|
290
286
|
baseSdk: sdk,
|
|
291
287
|
isInitiallyDisabled: false
|
|
292
288
|
}));
|
|
293
|
-
await (0, _react1.
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
await (0, _react1.waitFor)(()=>{
|
|
290
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
291
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
292
|
+
expect(field.setValue).toHaveBeenLastCalledWith('untitled-entry-2020-01-24-at-15-33-47');
|
|
293
|
+
});
|
|
297
294
|
await sdk.entry.fields['title-id'].setValue('Hello world!');
|
|
298
|
-
await (0, _react1.
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
295
|
+
await (0, _react1.waitFor)(()=>{
|
|
296
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
297
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
298
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
299
|
+
});
|
|
302
300
|
await sdk.entry.fields['title-id'].setValue('фраза написанная по русски');
|
|
303
|
-
await (0, _react1.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
301
|
+
await (0, _react1.waitFor)(()=>{
|
|
302
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
303
|
+
expect(field.setValue).toHaveBeenLastCalledWith('fraza-napisannaya-po-russki');
|
|
304
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(3);
|
|
305
|
+
});
|
|
307
306
|
});
|
|
308
307
|
it('should generate value from title if it is not empty', async ()=>{
|
|
309
308
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -315,15 +314,17 @@ describe('SlugEditor', ()=>{
|
|
|
315
314
|
baseSdk: sdk,
|
|
316
315
|
isInitiallyDisabled: false
|
|
317
316
|
}));
|
|
318
|
-
await (0, _react1.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
317
|
+
await (0, _react1.waitFor)(()=>{
|
|
318
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
319
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
320
|
+
expect(field.setValue).toHaveBeenLastCalledWith('this-is-initial-title-value');
|
|
321
|
+
});
|
|
322
322
|
await sdk.entry.fields['title-id'].setValue('Hello world!');
|
|
323
|
-
await (0, _react1.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
await (0, _react1.waitFor)(()=>{
|
|
324
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
325
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
326
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
327
|
+
});
|
|
327
328
|
});
|
|
328
329
|
it('should stop tracking value after user intentionally changes slug value', async ()=>{
|
|
329
330
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -335,28 +336,33 @@ describe('SlugEditor', ()=>{
|
|
|
335
336
|
baseSdk: sdk,
|
|
336
337
|
isInitiallyDisabled: false
|
|
337
338
|
}));
|
|
338
|
-
await (0, _react1.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
339
|
+
await (0, _react1.waitFor)(async ()=>{
|
|
340
|
+
await sdk.entry.fields['title-id'].setValue('Hello world!');
|
|
341
|
+
});
|
|
342
|
+
await (0, _react1.waitFor)(()=>{
|
|
343
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
344
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
345
|
+
expect(field.setValue).toHaveBeenCalledWith('untitled-entry-2020-01-24-at-15-33-47');
|
|
346
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
347
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
348
|
+
});
|
|
346
349
|
_react1.fireEvent.change(getByTestId('cf-ui-text-input'), {
|
|
347
350
|
target: {
|
|
348
351
|
value: 'new-custom-slug'
|
|
349
352
|
}
|
|
350
353
|
});
|
|
351
|
-
await (0, _react1.
|
|
352
|
-
|
|
353
|
-
|
|
354
|
+
await (0, _react1.waitFor)(()=>{
|
|
355
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
356
|
+
expect(field.setValue).toHaveBeenLastCalledWith('new-custom-slug');
|
|
357
|
+
});
|
|
354
358
|
await sdk.entry.fields['title-id'].setValue('I decided to update my title');
|
|
355
|
-
await (0, _react1.
|
|
356
|
-
|
|
359
|
+
await (0, _react1.waitFor)(()=>{
|
|
360
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
361
|
+
});
|
|
357
362
|
await sdk.entry.fields['title-id'].setValue('I decided to update my title again');
|
|
358
|
-
await (0, _react1.
|
|
359
|
-
|
|
363
|
+
await (0, _react1.waitFor)(()=>{
|
|
364
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
365
|
+
});
|
|
360
366
|
});
|
|
361
367
|
it('should start tracking again after potential slug equals real one', async ()=>{
|
|
362
368
|
const { field , sdk } = createMocks({
|
|
@@ -368,26 +374,31 @@ describe('SlugEditor', ()=>{
|
|
|
368
374
|
baseSdk: sdk,
|
|
369
375
|
isInitiallyDisabled: false
|
|
370
376
|
}));
|
|
371
|
-
await (0, _react1.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
377
|
+
await (0, _react1.waitFor)(async ()=>{
|
|
378
|
+
await sdk.entry.fields['title-id'].setValue('ABC DEF');
|
|
379
|
+
});
|
|
380
|
+
await (0, _react1.waitFor)(()=>{
|
|
381
|
+
expect(field.setValue).toHaveBeenLastCalledWith('abc-def');
|
|
382
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
383
|
+
});
|
|
376
384
|
_react1.fireEvent.change(getByTestId('cf-ui-text-input'), {
|
|
377
385
|
target: {
|
|
378
386
|
value: 'abc'
|
|
379
387
|
}
|
|
380
388
|
});
|
|
381
389
|
await sdk.entry.fields['title-id'].setValue('ABC D');
|
|
382
|
-
await (0, _react1.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
await
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
await (0, _react1.
|
|
390
|
+
await (0, _react1.waitFor)(()=>{
|
|
391
|
+
expect(field.setValue).toHaveBeenLastCalledWith('abc');
|
|
392
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
393
|
+
});
|
|
394
|
+
await (0, _react1.waitFor)(async ()=>{
|
|
395
|
+
await sdk.entry.fields['title-id'].setValue('ABC');
|
|
396
|
+
await sdk.entry.fields['title-id'].setValue('ABC ABC');
|
|
397
|
+
});
|
|
398
|
+
await (0, _react1.waitFor)(()=>{
|
|
399
|
+
expect(field.setValue).toHaveBeenLastCalledWith('abc-abc');
|
|
400
|
+
expect(field.setValue).toHaveBeenCalledTimes(4);
|
|
401
|
+
});
|
|
391
402
|
});
|
|
392
403
|
});
|
|
393
404
|
describe('for non default locales', ()=>{
|
|
@@ -413,10 +424,11 @@ describe('SlugEditor', ()=>{
|
|
|
413
424
|
baseSdk: sdk,
|
|
414
425
|
isInitiallyDisabled: false
|
|
415
426
|
}));
|
|
416
|
-
await (0, _react1.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
427
|
+
await (0, _react1.waitFor)(()=>{
|
|
428
|
+
expect(field.setValue).toHaveBeenCalledWith('untitled-entry-2020-01-24-at-15-33-47');
|
|
429
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('ru-RU', expect.any(Function));
|
|
430
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('de-DE', expect.any(Function));
|
|
431
|
+
});
|
|
420
432
|
});
|
|
421
433
|
it('locale is optional and has a fallback then it should track only current locale changes', async ()=>{
|
|
422
434
|
const { sdk , field , titleField } = createMocks();
|
|
@@ -440,10 +452,11 @@ describe('SlugEditor', ()=>{
|
|
|
440
452
|
baseSdk: sdk,
|
|
441
453
|
isInitiallyDisabled: false
|
|
442
454
|
}));
|
|
443
|
-
await (0, _react1.
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
455
|
+
await (0, _react1.waitFor)(()=>{
|
|
456
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
457
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('ru-RU', expect.any(Function));
|
|
458
|
+
expect(titleField.onValueChanged).not.toHaveBeenCalledWith('de-DE', expect.any(Function));
|
|
459
|
+
});
|
|
447
460
|
});
|
|
448
461
|
});
|
|
449
462
|
it('slug suggestion is limited to 75 symbols', async ()=>{
|
|
@@ -456,11 +469,13 @@ describe('SlugEditor', ()=>{
|
|
|
456
469
|
baseSdk: sdk,
|
|
457
470
|
isInitiallyDisabled: false
|
|
458
471
|
}));
|
|
459
|
-
await (0, _react1.
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
472
|
+
await (0, _react1.waitFor)(async ()=>{
|
|
473
|
+
await sdk.entry.fields['title-id'].setValue('a'.repeat(80));
|
|
474
|
+
});
|
|
475
|
+
await (0, _react1.waitFor)(()=>{
|
|
476
|
+
const expectedSlug = 'a'.repeat(75);
|
|
477
|
+
expect(field.setValue).toHaveBeenLastCalledWith(expectedSlug);
|
|
478
|
+
});
|
|
464
479
|
});
|
|
465
480
|
it('slug suggestion does not contain cut-off words', async ()=>{
|
|
466
481
|
const { field , sdk } = createMocks({
|
|
@@ -472,11 +487,13 @@ describe('SlugEditor', ()=>{
|
|
|
472
487
|
baseSdk: sdk,
|
|
473
488
|
isInitiallyDisabled: false
|
|
474
489
|
}));
|
|
475
|
-
await (0, _react1.
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
490
|
+
await (0, _react1.waitFor)(async ()=>{
|
|
491
|
+
await sdk.entry.fields['title-id'].setValue(`one two three ${'a'.repeat(80)}`);
|
|
492
|
+
});
|
|
493
|
+
await (0, _react1.waitFor)(()=>{
|
|
494
|
+
const expectedSlug = 'one-two-three';
|
|
495
|
+
expect(field.setValue).toHaveBeenLastCalledWith(expectedSlug);
|
|
496
|
+
});
|
|
480
497
|
});
|
|
481
498
|
it('should subscribe for changes in custom field id', async ()=>{
|
|
482
499
|
const { field , titleField , descriptionField , sdk } = createMocks({
|
|
@@ -494,15 +511,17 @@ describe('SlugEditor', ()=>{
|
|
|
494
511
|
}
|
|
495
512
|
}
|
|
496
513
|
}));
|
|
497
|
-
await (0, _react1.
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
514
|
+
await (0, _react1.waitFor)(()=>{
|
|
515
|
+
expect(titleField.onValueChanged).not.toHaveBeenCalled();
|
|
516
|
+
expect(descriptionField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
517
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
518
|
+
expect(field.setValue).toHaveBeenLastCalledWith('this-is-initial-description-value');
|
|
519
|
+
});
|
|
502
520
|
await sdk.entry.fields['description-id'].setValue('Hello world!');
|
|
503
|
-
await (0, _react1.
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
521
|
+
await (0, _react1.waitFor)(()=>{
|
|
522
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
523
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
524
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
525
|
+
});
|
|
507
526
|
});
|
|
508
527
|
});
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createFakeFieldAPI, createFakeLocalesAPI } from '@contentful/field-editor-test-utils';
|
|
3
|
-
import {
|
|
4
|
-
import identity from 'lodash/identity';
|
|
3
|
+
import { cleanup, configure, fireEvent, render, waitFor } from '@testing-library/react';
|
|
5
4
|
import '@testing-library/jest-dom/extend-expect';
|
|
6
5
|
import { SlugEditor } from './SlugEditor';
|
|
7
6
|
configure({
|
|
8
7
|
testIdAttribute: 'data-test-id'
|
|
9
8
|
});
|
|
10
|
-
jest.mock('lodash/throttle', ()=>({
|
|
11
|
-
default: identity
|
|
12
|
-
}), {
|
|
13
|
-
virtual: true
|
|
14
|
-
});
|
|
15
9
|
jest.mock('use-debounce', ()=>({
|
|
16
10
|
useDebounce: (text)=>[
|
|
17
11
|
text
|
|
@@ -87,12 +81,13 @@ describe('SlugEditor', ()=>{
|
|
|
87
81
|
baseSdk: sdk,
|
|
88
82
|
isInitiallyDisabled: false
|
|
89
83
|
}));
|
|
90
|
-
await
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
await waitFor(()=>{
|
|
85
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
86
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
87
|
+
expect(sdk.space.getEntries).not.toHaveBeenCalled();
|
|
88
|
+
expect(sdk.entry.fields['title-id'].getValue).toHaveBeenCalledTimes(1);
|
|
89
|
+
expect(sdk.entry.getSys).toHaveBeenCalledTimes(2);
|
|
90
|
+
});
|
|
96
91
|
});
|
|
97
92
|
it('when title and slug are the same field', async ()=>{
|
|
98
93
|
const { field , titleField , sdk } = createMocks();
|
|
@@ -102,9 +97,10 @@ describe('SlugEditor', ()=>{
|
|
|
102
97
|
baseSdk: sdk,
|
|
103
98
|
isInitiallyDisabled: false
|
|
104
99
|
}));
|
|
105
|
-
await
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
await waitFor(()=>{
|
|
101
|
+
expect(titleField.onValueChanged).not.toHaveBeenCalled();
|
|
102
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
103
|
+
});
|
|
108
104
|
});
|
|
109
105
|
it('when a saved slug is different from a title at the render', async ()=>{
|
|
110
106
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -116,9 +112,10 @@ describe('SlugEditor', ()=>{
|
|
|
116
112
|
baseSdk: sdk,
|
|
117
113
|
isInitiallyDisabled: false
|
|
118
114
|
}));
|
|
119
|
-
await
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
await waitFor(()=>{
|
|
116
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
117
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
118
|
+
});
|
|
122
119
|
});
|
|
123
120
|
});
|
|
124
121
|
describe('should check for uniqueness', ()=>{
|
|
@@ -144,18 +141,19 @@ describe('SlugEditor', ()=>{
|
|
|
144
141
|
baseSdk: sdk,
|
|
145
142
|
isInitiallyDisabled: false
|
|
146
143
|
}));
|
|
147
|
-
await
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
144
|
+
await waitFor(()=>{
|
|
145
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
146
|
+
expect(sdk.space.getEntries).toHaveBeenLastCalledWith({
|
|
147
|
+
content_type: 'content-type-id',
|
|
148
|
+
'fields.slug-id.en-US': 'slug-value',
|
|
149
|
+
limit: 0,
|
|
150
|
+
'sys.id[ne]': 'entry-id',
|
|
151
|
+
'sys.publishedAt[exists]': true
|
|
152
|
+
});
|
|
153
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(1);
|
|
154
|
+
expect(queryByTestId('slug-editor-spinner')).not.toBeInTheDocument();
|
|
155
|
+
expect(queryByText('This slug has already been published in another entry')).not.toBeInTheDocument();
|
|
156
|
+
});
|
|
159
157
|
});
|
|
160
158
|
it('if it is not published', async ()=>{
|
|
161
159
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -179,19 +177,20 @@ describe('SlugEditor', ()=>{
|
|
|
179
177
|
baseSdk: sdk,
|
|
180
178
|
isInitiallyDisabled: false
|
|
181
179
|
}));
|
|
182
|
-
await
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
180
|
+
await waitFor(()=>{
|
|
181
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
182
|
+
expect(sdk.space.getEntries).toHaveBeenLastCalledWith({
|
|
183
|
+
content_type: 'content-type-id',
|
|
184
|
+
'fields.slug-id.en-US': 'slug-value',
|
|
185
|
+
limit: 0,
|
|
186
|
+
'sys.id[ne]': 'entry-id',
|
|
187
|
+
'sys.publishedAt[exists]': true
|
|
188
|
+
});
|
|
189
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(1);
|
|
190
|
+
expect(queryByTestId('slug-editor-spinner')).not.toBeInTheDocument();
|
|
191
|
+
expect(queryByText('This slug has already been published in another entry')).toBeInTheDocument();
|
|
192
|
+
expect(getByTestId('cf-ui-text-input')).toHaveValue('slug-value');
|
|
193
|
+
});
|
|
195
194
|
sdk.space.getEntries.mockResolvedValue({
|
|
196
195
|
total: 0
|
|
197
196
|
});
|
|
@@ -200,18 +199,19 @@ describe('SlugEditor', ()=>{
|
|
|
200
199
|
value: '123'
|
|
201
200
|
}
|
|
202
201
|
});
|
|
203
|
-
await
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
202
|
+
await waitFor(()=>{
|
|
203
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
204
|
+
expect(field.setValue).toHaveBeenCalledWith('123');
|
|
205
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
206
|
+
expect(sdk.space.getEntries).toHaveBeenLastCalledWith({
|
|
207
|
+
content_type: 'content-type-id',
|
|
208
|
+
'fields.slug-id.en-US': '123',
|
|
209
|
+
limit: 0,
|
|
210
|
+
'sys.id[ne]': 'entry-id',
|
|
211
|
+
'sys.publishedAt[exists]': true
|
|
212
|
+
});
|
|
213
|
+
expect(queryByText('This slug has already been published in another entry')).not.toBeInTheDocument();
|
|
214
|
+
});
|
|
215
215
|
});
|
|
216
216
|
});
|
|
217
217
|
describe('should react to title changes', ()=>{
|
|
@@ -225,12 +225,13 @@ describe('SlugEditor', ()=>{
|
|
|
225
225
|
baseSdk: sdk,
|
|
226
226
|
isInitiallyDisabled: true
|
|
227
227
|
}));
|
|
228
|
-
await
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
await waitFor(()=>{
|
|
229
|
+
expect(field.setValue).toHaveBeenCalled();
|
|
230
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
231
|
+
expect(sdk.space.getEntries).toHaveBeenCalled();
|
|
232
|
+
expect(sdk.entry.fields['title-id'].getValue).toHaveBeenCalledTimes(1);
|
|
233
|
+
expect(sdk.entry.getSys).toHaveBeenCalledTimes(2);
|
|
234
|
+
});
|
|
234
235
|
});
|
|
235
236
|
it('should generate unique value with date if title is empty', async ()=>{
|
|
236
237
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -242,20 +243,23 @@ describe('SlugEditor', ()=>{
|
|
|
242
243
|
baseSdk: sdk,
|
|
243
244
|
isInitiallyDisabled: false
|
|
244
245
|
}));
|
|
245
|
-
await
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
await waitFor(()=>{
|
|
247
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
248
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
249
|
+
expect(field.setValue).toHaveBeenLastCalledWith('untitled-entry-2020-01-24-at-15-33-47');
|
|
250
|
+
});
|
|
249
251
|
await sdk.entry.fields['title-id'].setValue('Hello world!');
|
|
250
|
-
await
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
await waitFor(()=>{
|
|
253
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
254
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
255
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
256
|
+
});
|
|
254
257
|
await sdk.entry.fields['title-id'].setValue('фраза написанная по русски');
|
|
255
|
-
await
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
await waitFor(()=>{
|
|
259
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
260
|
+
expect(field.setValue).toHaveBeenLastCalledWith('fraza-napisannaya-po-russki');
|
|
261
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(3);
|
|
262
|
+
});
|
|
259
263
|
});
|
|
260
264
|
it('should generate value from title if it is not empty', async ()=>{
|
|
261
265
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -267,15 +271,17 @@ describe('SlugEditor', ()=>{
|
|
|
267
271
|
baseSdk: sdk,
|
|
268
272
|
isInitiallyDisabled: false
|
|
269
273
|
}));
|
|
270
|
-
await
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
+
await waitFor(()=>{
|
|
275
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
276
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
277
|
+
expect(field.setValue).toHaveBeenLastCalledWith('this-is-initial-title-value');
|
|
278
|
+
});
|
|
274
279
|
await sdk.entry.fields['title-id'].setValue('Hello world!');
|
|
275
|
-
await
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
280
|
+
await waitFor(()=>{
|
|
281
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
282
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
283
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
284
|
+
});
|
|
279
285
|
});
|
|
280
286
|
it('should stop tracking value after user intentionally changes slug value', async ()=>{
|
|
281
287
|
const { field , titleField , sdk } = createMocks({
|
|
@@ -287,28 +293,33 @@ describe('SlugEditor', ()=>{
|
|
|
287
293
|
baseSdk: sdk,
|
|
288
294
|
isInitiallyDisabled: false
|
|
289
295
|
}));
|
|
290
|
-
await
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
await waitFor(async ()=>{
|
|
297
|
+
await sdk.entry.fields['title-id'].setValue('Hello world!');
|
|
298
|
+
});
|
|
299
|
+
await waitFor(()=>{
|
|
300
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
301
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
302
|
+
expect(field.setValue).toHaveBeenCalledWith('untitled-entry-2020-01-24-at-15-33-47');
|
|
303
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
304
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
305
|
+
});
|
|
298
306
|
fireEvent.change(getByTestId('cf-ui-text-input'), {
|
|
299
307
|
target: {
|
|
300
308
|
value: 'new-custom-slug'
|
|
301
309
|
}
|
|
302
310
|
});
|
|
303
|
-
await
|
|
304
|
-
|
|
305
|
-
|
|
311
|
+
await waitFor(()=>{
|
|
312
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
313
|
+
expect(field.setValue).toHaveBeenLastCalledWith('new-custom-slug');
|
|
314
|
+
});
|
|
306
315
|
await sdk.entry.fields['title-id'].setValue('I decided to update my title');
|
|
307
|
-
await
|
|
308
|
-
|
|
316
|
+
await waitFor(()=>{
|
|
317
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
318
|
+
});
|
|
309
319
|
await sdk.entry.fields['title-id'].setValue('I decided to update my title again');
|
|
310
|
-
await
|
|
311
|
-
|
|
320
|
+
await waitFor(()=>{
|
|
321
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
322
|
+
});
|
|
312
323
|
});
|
|
313
324
|
it('should start tracking again after potential slug equals real one', async ()=>{
|
|
314
325
|
const { field , sdk } = createMocks({
|
|
@@ -320,26 +331,31 @@ describe('SlugEditor', ()=>{
|
|
|
320
331
|
baseSdk: sdk,
|
|
321
332
|
isInitiallyDisabled: false
|
|
322
333
|
}));
|
|
323
|
-
await
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
334
|
+
await waitFor(async ()=>{
|
|
335
|
+
await sdk.entry.fields['title-id'].setValue('ABC DEF');
|
|
336
|
+
});
|
|
337
|
+
await waitFor(()=>{
|
|
338
|
+
expect(field.setValue).toHaveBeenLastCalledWith('abc-def');
|
|
339
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
340
|
+
});
|
|
328
341
|
fireEvent.change(getByTestId('cf-ui-text-input'), {
|
|
329
342
|
target: {
|
|
330
343
|
value: 'abc'
|
|
331
344
|
}
|
|
332
345
|
});
|
|
333
346
|
await sdk.entry.fields['title-id'].setValue('ABC D');
|
|
334
|
-
await
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
await
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
await
|
|
347
|
+
await waitFor(()=>{
|
|
348
|
+
expect(field.setValue).toHaveBeenLastCalledWith('abc');
|
|
349
|
+
expect(field.setValue).toHaveBeenCalledTimes(3);
|
|
350
|
+
});
|
|
351
|
+
await waitFor(async ()=>{
|
|
352
|
+
await sdk.entry.fields['title-id'].setValue('ABC');
|
|
353
|
+
await sdk.entry.fields['title-id'].setValue('ABC ABC');
|
|
354
|
+
});
|
|
355
|
+
await waitFor(()=>{
|
|
356
|
+
expect(field.setValue).toHaveBeenLastCalledWith('abc-abc');
|
|
357
|
+
expect(field.setValue).toHaveBeenCalledTimes(4);
|
|
358
|
+
});
|
|
343
359
|
});
|
|
344
360
|
});
|
|
345
361
|
describe('for non default locales', ()=>{
|
|
@@ -365,10 +381,11 @@ describe('SlugEditor', ()=>{
|
|
|
365
381
|
baseSdk: sdk,
|
|
366
382
|
isInitiallyDisabled: false
|
|
367
383
|
}));
|
|
368
|
-
await
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
384
|
+
await waitFor(()=>{
|
|
385
|
+
expect(field.setValue).toHaveBeenCalledWith('untitled-entry-2020-01-24-at-15-33-47');
|
|
386
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('ru-RU', expect.any(Function));
|
|
387
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('de-DE', expect.any(Function));
|
|
388
|
+
});
|
|
372
389
|
});
|
|
373
390
|
it('locale is optional and has a fallback then it should track only current locale changes', async ()=>{
|
|
374
391
|
const { sdk , field , titleField } = createMocks();
|
|
@@ -392,10 +409,11 @@ describe('SlugEditor', ()=>{
|
|
|
392
409
|
baseSdk: sdk,
|
|
393
410
|
isInitiallyDisabled: false
|
|
394
411
|
}));
|
|
395
|
-
await
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
412
|
+
await waitFor(()=>{
|
|
413
|
+
expect(field.setValue).not.toHaveBeenCalled();
|
|
414
|
+
expect(titleField.onValueChanged).toHaveBeenCalledWith('ru-RU', expect.any(Function));
|
|
415
|
+
expect(titleField.onValueChanged).not.toHaveBeenCalledWith('de-DE', expect.any(Function));
|
|
416
|
+
});
|
|
399
417
|
});
|
|
400
418
|
});
|
|
401
419
|
it('slug suggestion is limited to 75 symbols', async ()=>{
|
|
@@ -408,11 +426,13 @@ describe('SlugEditor', ()=>{
|
|
|
408
426
|
baseSdk: sdk,
|
|
409
427
|
isInitiallyDisabled: false
|
|
410
428
|
}));
|
|
411
|
-
await
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
429
|
+
await waitFor(async ()=>{
|
|
430
|
+
await sdk.entry.fields['title-id'].setValue('a'.repeat(80));
|
|
431
|
+
});
|
|
432
|
+
await waitFor(()=>{
|
|
433
|
+
const expectedSlug = 'a'.repeat(75);
|
|
434
|
+
expect(field.setValue).toHaveBeenLastCalledWith(expectedSlug);
|
|
435
|
+
});
|
|
416
436
|
});
|
|
417
437
|
it('slug suggestion does not contain cut-off words', async ()=>{
|
|
418
438
|
const { field , sdk } = createMocks({
|
|
@@ -424,11 +444,13 @@ describe('SlugEditor', ()=>{
|
|
|
424
444
|
baseSdk: sdk,
|
|
425
445
|
isInitiallyDisabled: false
|
|
426
446
|
}));
|
|
427
|
-
await
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
447
|
+
await waitFor(async ()=>{
|
|
448
|
+
await sdk.entry.fields['title-id'].setValue(`one two three ${'a'.repeat(80)}`);
|
|
449
|
+
});
|
|
450
|
+
await waitFor(()=>{
|
|
451
|
+
const expectedSlug = 'one-two-three';
|
|
452
|
+
expect(field.setValue).toHaveBeenLastCalledWith(expectedSlug);
|
|
453
|
+
});
|
|
432
454
|
});
|
|
433
455
|
it('should subscribe for changes in custom field id', async ()=>{
|
|
434
456
|
const { field , titleField , descriptionField , sdk } = createMocks({
|
|
@@ -446,15 +468,17 @@ describe('SlugEditor', ()=>{
|
|
|
446
468
|
}
|
|
447
469
|
}
|
|
448
470
|
}));
|
|
449
|
-
await
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
471
|
+
await waitFor(()=>{
|
|
472
|
+
expect(titleField.onValueChanged).not.toHaveBeenCalled();
|
|
473
|
+
expect(descriptionField.onValueChanged).toHaveBeenCalledWith('en-US', expect.any(Function));
|
|
474
|
+
expect(field.setValue).toHaveBeenCalledTimes(1);
|
|
475
|
+
expect(field.setValue).toHaveBeenLastCalledWith('this-is-initial-description-value');
|
|
476
|
+
});
|
|
454
477
|
await sdk.entry.fields['description-id'].setValue('Hello world!');
|
|
455
|
-
await
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
478
|
+
await waitFor(()=>{
|
|
479
|
+
expect(field.setValue).toHaveBeenCalledTimes(2);
|
|
480
|
+
expect(field.setValue).toHaveBeenLastCalledWith('hello-world');
|
|
481
|
+
expect(sdk.space.getEntries).toHaveBeenCalledTimes(2);
|
|
482
|
+
});
|
|
459
483
|
});
|
|
460
484
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-slug",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,21 +38,20 @@
|
|
|
38
38
|
"@contentful/f36-components": "^4.0.27",
|
|
39
39
|
"@contentful/f36-icons": "^4.1.0",
|
|
40
40
|
"@contentful/f36-tokens": "^4.0.0",
|
|
41
|
-
"@contentful/field-editor-shared": "^1.3.
|
|
41
|
+
"@contentful/field-editor-shared": "^1.3.1",
|
|
42
42
|
"@types/speakingurl": "^13.0.2",
|
|
43
43
|
"emotion": "^10.0.17",
|
|
44
44
|
"lodash": "^4.17.15",
|
|
45
|
-
"lodash-es": "^4.17.15",
|
|
46
45
|
"speakingurl": "^13.0.0",
|
|
47
46
|
"use-debounce": "^7.0.0"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
49
|
"@contentful/app-sdk": "^4.2.0",
|
|
51
|
-
"@contentful/field-editor-test-utils": "^1.4.
|
|
50
|
+
"@contentful/field-editor-test-utils": "^1.4.1"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
53
|
"@contentful/app-sdk": "^4.2.0",
|
|
55
54
|
"react": ">=16.8.0"
|
|
56
55
|
},
|
|
57
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "ca904b19ca794a2c40d82e1f7ede9e0be3560f22"
|
|
58
57
|
}
|