@@ -308,7 +308,112 @@ test('can add a block element with inline editing mode enabled', async ({umbraco
308
308
expect ( await umbracoApi . document . doesNameExist ( contentName ) ) . toBeTruthy ( ) ;
309
309
const contentData = await umbracoApi . document . getByName ( contentName ) ;
310
310
expect ( contentData . values [ 0 ] . value . contentData [ 0 ] . values [ 0 ] . value ) . toEqual ( inputText ) ;
311
- const blockListValue = contentData . values . find ( item => item . editorAlias === "Umbraco.BlockGrid" ) ?. value ;
312
- expect ( blockListValue ) . toBeTruthy ( ) ;
311
+ const blockGridValue = contentData . values . find ( item => item . editorAlias === "Umbraco.BlockGrid" ) ?. value ;
312
+ expect ( blockGridValue ) . toBeTruthy ( ) ;
313
313
await umbracoUi . content . doesPropertyContainValue ( propertyInBlock , inputText ) ;
314
314
} ) ;
315
+
316
+ test ( 'can add an invariant block element with an invariant RTE Tiptap in the content' , async ( { umbracoApi, umbracoUi} ) => {
317
+ // Arrange
318
+ const inputText = 'This is block test' ;
319
+ const customRTEDataTypeName = 'TestRTETiptap' ;
320
+ const customElementTypeName = 'BlockGridWithRTEElement' ;
321
+ const customRTEDataTypeId = await umbracoApi . dataType . createDefaultTiptapDataType ( customRTEDataTypeName ) ;
322
+ const customElementTypeId = await umbracoApi . documentType . createDefaultElementType ( customElementTypeName , groupName , customRTEDataTypeName , customRTEDataTypeId ) ;
323
+ const customDataTypeId = await umbracoApi . dataType . createBlockGridWithPermissions ( customDataTypeName , customElementTypeId , true , true ) ;
324
+ const documentTypeId = await umbracoApi . documentType . createDocumentTypeWithPropertyEditor ( documentTypeName , customDataTypeName , customDataTypeId ) ;
325
+ await umbracoApi . document . createDefaultDocument ( contentName , documentTypeId ) ;
326
+ await umbracoUi . goToBackOffice ( ) ;
327
+ await umbracoUi . content . goToSection ( ConstantHelper . sections . content ) ;
328
+
329
+ // Act
330
+ await umbracoUi . content . goToContentWithName ( contentName ) ;
331
+ await umbracoUi . content . clickAddBlockElementButton ( ) ;
332
+ await umbracoUi . content . clickTextButtonWithName ( customElementTypeName ) ;
333
+ await umbracoUi . content . enterRTETipTapEditor ( inputText ) ;
334
+ await umbracoUi . content . clickCreateModalButton ( ) ;
335
+ await umbracoUi . content . clickSaveButtonForContent ( ) ;
336
+
337
+ // Assert
338
+ await umbracoUi . content . isSuccessStateVisibleForSaveButton ( ) ;
339
+ const contentData = await umbracoApi . document . getByName ( contentName ) ;
340
+ expect ( contentData . values [ 0 ] . value . contentData [ 0 ] . values [ 0 ] . value . markup ) . toContain ( inputText ) ;
341
+ const blockGridValue = contentData . values . find ( item => item . editorAlias === "Umbraco.BlockGrid" ) ?. value ;
342
+ expect ( blockGridValue ) . toBeTruthy ( ) ;
343
+
344
+ // Clean
345
+ await umbracoApi . dataType . ensureNameNotExists ( customRTEDataTypeName ) ;
346
+ await umbracoApi . documentType . ensureNameNotExists ( customElementTypeName ) ;
347
+ } ) ;
348
+
349
+ test ( 'can add a variant block element with variant RTE Tiptap in the content' , async ( { umbracoApi, umbracoUi} ) => {
350
+ // Arrange
351
+ const inputText = 'This is block test' ;
352
+ const customRTEDataTypeName = 'TestRTETiptap' ;
353
+ const customElementTypeName = 'BlockGridWithRTEElement' ;
354
+ await umbracoApi . language . createDanishLanguage ( ) ;
355
+ const customRTEDataTypeId = await umbracoApi . dataType . createDefaultTiptapDataType ( customRTEDataTypeName ) ;
356
+ const customElementTypeId = await umbracoApi . documentType . createDefaultElementType ( customElementTypeName , groupName , customRTEDataTypeName , customRTEDataTypeId ) ;
357
+ const customDataTypeId = await umbracoApi . dataType . createBlockGridWithPermissions ( customDataTypeName , customElementTypeId , true , true ) ;
358
+ const documentTypeId = await umbracoApi . documentType . createDocumentTypeWithPropertyEditor ( documentTypeName , customDataTypeName , customDataTypeId , 'testGroup' , true ) ;
359
+ await umbracoApi . document . createDefaultDocumentWithCulture ( contentName , documentTypeId , 'en-US' ) ;
360
+ await umbracoUi . goToBackOffice ( ) ;
361
+ await umbracoUi . content . goToSection ( ConstantHelper . sections . content ) ;
362
+
363
+ // Act
364
+ await umbracoUi . content . goToContentWithName ( contentName ) ;
365
+ await umbracoUi . content . clickAddBlockElementButton ( ) ;
366
+ await umbracoUi . content . clickTextButtonWithName ( customElementTypeName ) ;
367
+ await umbracoUi . content . enterRTETipTapEditor ( inputText ) ;
368
+ await umbracoUi . content . clickCreateModalButton ( ) ;
369
+ await umbracoUi . content . clickSaveButtonForContent ( ) ;
370
+ await umbracoUi . content . clickSaveButton ( ) ;
371
+
372
+ // Assert
373
+ await umbracoUi . content . isSuccessStateVisibleForSaveButton ( ) ;
374
+ const contentData = await umbracoApi . document . getByName ( contentName ) ;
375
+ expect ( contentData . values [ 0 ] . value . contentData [ 0 ] . values [ 0 ] . value . markup ) . toContain ( inputText ) ;
376
+ const blockGridValue = contentData . values . find ( item => item . editorAlias === "Umbraco.BlockGrid" ) ?. value ;
377
+ expect ( blockGridValue ) . toBeTruthy ( ) ;
378
+
379
+ // Clean
380
+ await umbracoApi . dataType . ensureNameNotExists ( customRTEDataTypeName ) ;
381
+ await umbracoApi . documentType . ensureNameNotExists ( customElementTypeName ) ;
382
+ await umbracoApi . language . ensureNameNotExists ( 'Danish' ) ;
383
+ } ) ;
384
+
385
+ test ( 'can add a variant block element with invariant RTE Tiptap in the content' , async ( { umbracoApi, umbracoUi} ) => {
386
+ // Arrange
387
+ const inputText = 'This is block test' ;
388
+ const customRTEDataTypeName = 'TestRTETiptap' ;
389
+ const customElementTypeName = 'BlockGridWithRTEElement' ;
390
+ await umbracoApi . language . createDanishLanguage ( ) ;
391
+ const customRTEDataTypeId = await umbracoApi . dataType . createDefaultTiptapDataType ( customRTEDataTypeName ) ;
392
+ const customElementTypeId = await umbracoApi . documentType . createDefaultElementType ( customElementTypeName , groupName , customRTEDataTypeName , customRTEDataTypeId ) ;
393
+ const customDataTypeId = await umbracoApi . dataType . createBlockGridWithPermissions ( customDataTypeName , customElementTypeId , true , true ) ;
394
+ const documentTypeId = await umbracoApi . documentType . createVariantDocumentTypeWithInvariantPropertyEditor ( documentTypeName , customDataTypeName , customDataTypeId , 'testGroup' , true ) ;
395
+ await umbracoApi . document . createDefaultDocumentWithCulture ( contentName , documentTypeId , 'en-US' ) ;
396
+ await umbracoUi . goToBackOffice ( ) ;
397
+ await umbracoUi . content . goToSection ( ConstantHelper . sections . content ) ;
398
+
399
+ // Act
400
+ await umbracoUi . content . goToContentWithName ( contentName ) ;
401
+ await umbracoUi . content . clickAddBlockElementButton ( ) ;
402
+ await umbracoUi . content . clickTextButtonWithName ( customElementTypeName ) ;
403
+ await umbracoUi . content . enterRTETipTapEditor ( inputText ) ;
404
+ await umbracoUi . content . clickCreateModalButton ( ) ;
405
+ await umbracoUi . content . clickSaveButtonForContent ( ) ;
406
+ await umbracoUi . content . clickSaveButton ( ) ;
407
+
408
+ // Assert
409
+ await umbracoUi . content . isSuccessStateVisibleForSaveButton ( ) ;
410
+ const contentData = await umbracoApi . document . getByName ( contentName ) ;
411
+ expect ( contentData . values [ 0 ] . value . contentData [ 0 ] . values [ 0 ] . value . markup ) . toContain ( inputText ) ;
412
+ const blockGridValue = contentData . values . find ( item => item . editorAlias === "Umbraco.BlockGrid" ) ?. value ;
413
+ expect ( blockGridValue ) . toBeTruthy ( ) ;
414
+
415
+ // Clean
416
+ await umbracoApi . dataType . ensureNameNotExists ( customRTEDataTypeName ) ;
417
+ await umbracoApi . documentType . ensureNameNotExists ( customElementTypeName ) ;
418
+ await umbracoApi . language . ensureNameNotExists ( 'Danish' ) ;
419
+ } ) ;
0 commit comments