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
This commit is contained in:
Andreas Zerbst
2025-04-08 09:53:07 +02:00
committed by GitHub
parent 84d0ae3ea2
commit 86e7343f99
3 changed files with 36 additions and 9 deletions

View File

@@ -8,7 +8,7 @@
"hasInstallScript": true,
"dependencies": {
"@umbraco/json-models-builders": "^2.0.31",
"@umbraco/playwright-testhelpers": "^15.0.42",
"@umbraco/playwright-testhelpers": "^15.0.44",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
@@ -58,20 +58,21 @@
}
},
"node_modules/@umbraco/json-models-builders": {
"version": "2.0.31",
"resolved": "https://registry.npmjs.org/@umbraco/json-models-builders/-/json-models-builders-2.0.31.tgz",
"integrity": "sha512-RGulJazaSjp6ZfHYACXUKDQuF055oXx+Kk3Q7/+PyfGZWRngT7V799Mal1vnrG7W9EDEX9Up+AP22O/alYj3Gg==",
"version": "2.0.32",
"resolved": "https://registry.npmjs.org/@umbraco/json-models-builders/-/json-models-builders-2.0.32.tgz",
"integrity": "sha512-Aw7yBu8ePNxdjS7Q61j5KPFsiOS+IGCYxBX0H4KWbjXTdvL/PsB98KiqbDHHKFnp0fF1b2ffwJAI6jmvnxPBzg==",
"license": "MIT",
"dependencies": {
"camelize": "^1.0.1"
}
},
"node_modules/@umbraco/playwright-testhelpers": {
"version": "15.0.42",
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-15.0.42.tgz",
"integrity": "sha512-5UfdS+KvX+SNbEaw7ERka4Px3+VSS8nkcZR94FrXGmF5OVTlJkCw70uYXwB8ysc8ccsVQq23CfS9LPurgG8xXg==",
"version": "15.0.44",
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-15.0.44.tgz",
"integrity": "sha512-rbStBJG0bdVfs9pzEjAhArhcPoQbuvrUpvDJLbEMBcg54lRFH0I5nzcAimdZaY4UWh2r0i9ANfjv9E25NJxRUg==",
"license": "MIT",
"dependencies": {
"@umbraco/json-models-builders": "2.0.31",
"@umbraco/json-models-builders": "2.0.32",
"node-fetch": "^2.6.7"
}
},

View File

@@ -21,7 +21,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.31",
"@umbraco/playwright-testhelpers": "^15.0.42",
"@umbraco/playwright-testhelpers": "^15.0.44",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"

View File

@@ -334,3 +334,29 @@ test('can not copy a block from a block grid to a block list without allowed blo
// Clean
await umbracoApi.documentType.ensureNameNotExists(blockListElementTypeName);
});
test('can not copy a block from a block grid to root without allowed in root', async ({umbracoApi, umbracoUi}) => {
// Arrange
const secondElementTypeName = 'SecondElementType';
const areaAlias = 'testArea';
await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName);
const secondElementTypeId = await umbracoApi.documentType.createEmptyElementType(secondElementTypeName);
const blockGridId = await umbracoApi.dataType.createBlockGridWithAnAreaInABlockWithAllowInAreasAndASecondBlock(blockGridDataTypeName, elementTypeId, secondElementTypeId, areaAlias, true, 'TestCreateLabel' ,12 ,1, 0 , 10, false, true);
const areaKey = await umbracoApi.dataType.getBlockGridAreaKeyFromBlock(blockGridDataTypeName, elementTypeId, areaAlias);
const documentTypeId = await umbracoApi.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridDataTypeName, blockGridId, groupName);
await umbracoApi.document.createDocumentWithABlockGridEditorWithABlockThatContainsABlockInAnArea(contentName, documentTypeId, blockGridDataTypeName, elementTypeId, areaKey, secondElementTypeId, AliasHelper.toAlias(elementPropertyName), blockPropertyValue, richTextDataTypeUiAlias);
await umbracoUi.goToBackOffice();
await umbracoUi.content.goToSection(ConstantHelper.sections.content);
await umbracoUi.content.goToContentWithName(contentName);
// Act
await umbracoUi.content.clickCopyBlockGridBlockButton(groupName, blockGridDataTypeName, secondElementTypeName, 1);
await umbracoUi.content.clickActionsMenuForProperty(groupName, blockGridDataTypeName);
await umbracoUi.content.clickExactReplaceButton();
// Assert
await umbracoUi.content.doesClipboardContainCopiedBlocksCount(0);
// Clean
await umbracoApi.documentType.ensureNameNotExists(secondElementTypeName);
});