Skip to content

Commit 86e7343

Browse files
authored
V15 QA added clipboard test for not being able to copy to root when block is not allowed at root (#18937)
* Added clipboard test * Bumped version * Updated to use the name * Run all tests on the pipeline * Reverted command
1 parent 84d0ae3 commit 86e7343

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Umbraco.Tests.AcceptanceTest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@umbraco/json-models-builders": "^2.0.31",
24-
"@umbraco/playwright-testhelpers": "^15.0.42",
24+
"@umbraco/playwright-testhelpers": "^15.0.44",
2525
"camelize": "^1.0.0",
2626
"dotenv": "^16.3.1",
2727
"node-fetch": "^2.6.7"

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/Clipboard/ClipboardBlockGridBlocks.spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,29 @@ test('can not copy a block from a block grid to a block list without allowed blo
334334
// Clean
335335
await umbracoApi.documentType.ensureNameNotExists(blockListElementTypeName);
336336
});
337+
338+
test('can not copy a block from a block grid to root without allowed in root', async ({umbracoApi, umbracoUi}) => {
339+
// Arrange
340+
const secondElementTypeName = 'SecondElementType';
341+
const areaAlias = 'testArea';
342+
await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName);
343+
const secondElementTypeId = await umbracoApi.documentType.createEmptyElementType(secondElementTypeName);
344+
const blockGridId = await umbracoApi.dataType.createBlockGridWithAnAreaInABlockWithAllowInAreasAndASecondBlock(blockGridDataTypeName, elementTypeId, secondElementTypeId, areaAlias, true, 'TestCreateLabel' ,12 ,1, 0 , 10, false, true);
345+
const areaKey = await umbracoApi.dataType.getBlockGridAreaKeyFromBlock(blockGridDataTypeName, elementTypeId, areaAlias);
346+
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridDataTypeName, blockGridId, groupName);
347+
await umbracoApi.document.createDocumentWithABlockGridEditorWithABlockThatContainsABlockInAnArea(contentName, documentTypeId, blockGridDataTypeName, elementTypeId, areaKey, secondElementTypeId, AliasHelper.toAlias(elementPropertyName), blockPropertyValue, richTextDataTypeUiAlias);
348+
await umbracoUi.goToBackOffice();
349+
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
350+
await umbracoUi.content.goToContentWithName(contentName);
351+
352+
// Act
353+
await umbracoUi.content.clickCopyBlockGridBlockButton(groupName, blockGridDataTypeName, secondElementTypeName, 1);
354+
await umbracoUi.content.clickActionsMenuForProperty(groupName, blockGridDataTypeName);
355+
await umbracoUi.content.clickExactReplaceButton();
356+
357+
// Assert
358+
await umbracoUi.content.doesClipboardContainCopiedBlocksCount(0);
359+
360+
// Clean
361+
await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName);
362+
});

0 commit comments

Comments
 (0)