Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';
import {AliasHelper, ConstantHelper, test} from '@umbraco/playwright-testhelpers';
import {expect} from "@playwright/test";

const contentName = 'TestContent';
Expand Down Expand Up @@ -85,3 +85,54 @@ test('can publish content with RTE Tiptap property editor', async ({umbracoApi,
expect(contentData.variants[0].state).toBe(expectedState);
expect(contentData.values[0].value.markup).toEqual('<p>' + inputText + '</p>');
});

// This is a test for the regression issue #19763
test('can save a variant content node after removing embedded block in RTE', async ({umbracoApi, umbracoUi}) => {
// Arrange
// Language
const danishIsoCode = 'da';
await umbracoApi.language.createDanishLanguage();
// Content Names
const englishContentName = 'English Content';
const danishContentName = 'Danish Content';
// Element Type
const elementTypeName = 'Default Element Type';
const elementTypeGroupName = 'Content';
const elementTypeDataTypeName = 'Textstring';
const elementTypeDataType = await umbracoApi.dataType.getByName(elementTypeDataTypeName);
// Rich Text Editor
const richTextEditorDataTypeName = 'Rich Text Editor with a block';
const textStringValue = 'Block Content';
const elementTypeId = await umbracoApi.documentType.createDefaultElementTypeWithVaryByCulture(elementTypeName, elementTypeGroupName, elementTypeDataTypeName, elementTypeDataType.id, true, false);
const richTextEditorId = await umbracoApi.dataType.createRichTextEditorWithABlock(richTextEditorDataTypeName, elementTypeId);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, richTextEditorDataTypeName, richTextEditorId, 'TestGroup', true, false);
const cultures = [{isoCode: 'en-US', name: englishContentName}, {isoCode: 'da', name: danishContentName}];
await umbracoApi.document.createDocumentWithMultipleVariantsWithSharedProperty(contentName, documentTypeId, AliasHelper.toAlias(richTextEditorDataTypeName), 'Umbraco.RichText', cultures, '');
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
await umbracoUi.content.goToContentWithName(englishContentName);

// Act
await umbracoUi.content.clickInsertBlockButton();
await umbracoUi.content.clickLinkWithName(elementTypeName);
await umbracoUi.content.enterTextstring(textStringValue);
await umbracoUi.content.clickCreateModalButton();
await umbracoUi.content.clickSaveButtonForContent();
await umbracoUi.content.clickSaveButton();
const contentData = await umbracoApi.document.getByName(englishContentName);
expect(contentData.values[0].value.blocks.contentData[0].values[0].value).toBe(textStringValue);
await umbracoUi.content.clearTipTapEditor();
await umbracoUi.content.clickSaveButtonForContent();
await umbracoUi.content.clickSaveButton();

// Assert
await umbracoUi.content.isErrorNotificationVisible(false);
await umbracoUi.content.waitForContentToBeCreated();
expect(await umbracoApi.document.doesNameExist(englishContentName)).toBeTruthy();

// Clean
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.documentType.ensureNameNotExists(elementTypeName);
await umbracoApi.dataType.ensureNameNotExists(richTextEditorDataTypeName);
await umbracoApi.language.ensureIsoCodeNotExists(danishIsoCode);
});
Loading