From 9039f3030bbeebd8e11605b1e843edc2736cb441 Mon Sep 17 00:00:00 2001 From: Mole Date: Fri, 9 Oct 2020 10:39:20 +0200 Subject: [PATCH] Fix content with contentpicker after renaming doctype --- .../cypress/integration/Content/content.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts index e52f109b1a..4422df9859 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts @@ -503,10 +503,8 @@ context('Content', () => { it('Content with contentpicker', () => { const pickerDocTypeName = 'Content picker doc type'; - const groupName = 'ContentPickerGroup'; - const alias = AliasHelper.toAlias(pickerDocTypeName); + const pickerDocTypeAlias = AliasHelper.toAlias(pickerDocTypeName); const pickedDocTypeName = 'Picked content document type'; - const pickedNodeName = 'Content to pick'; cy.deleteAllContent(); cy.umbracoEnsureDocumentTypeNameNotExists(pickerDocTypeName); @@ -529,7 +527,7 @@ context('Content', () => { .withContentTypeAlias(generatedType["alias"]) .withAction("publishNew") .addVariant() - .withName(pickedNodeName) + .withName('Content to pick') .withSave(true) .withPublish(true) .addProperty() @@ -546,11 +544,11 @@ context('Content', () => { // Create the doctype with a the picker const pickerDocType = new DocumentTypeBuilder() .withName(pickerDocTypeName) - .withAlias(alias) + .withAlias(pickerDocTypeAlias) .withAllowAsRoot(true) - .withDefaultTemplate(alias) + .withDefaultTemplate(pickerDocTypeAlias) .addGroup() - .withName(groupName) + .withName('ContentPickerGroup') .addContentPickerProperty() .withAlias('picker') .done() @@ -560,7 +558,7 @@ context('Content', () => { cy.saveDocumentType(pickerDocType); // Edit it the template to allow us to verify the rendered view. - cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Web.Mvc.UmbracoViewPage + cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Web.Mvc.UmbracoViewPage @using ContentModels = Umbraco.Web.PublishedModels; @{ Layout = null; @@ -577,7 +575,7 @@ context('Content', () => { // Create content with content picker cy.get('.umb-tree-root-link').rightclick(); cy.get('.-opens-dialog > .umb-action-link').click(); - cy.get('[data-element="action-create-contentPickerType"] > .umb-action-link').click(); + cy.get('[data-element="action-create-' + pickerDocTypeAlias + '"] > .umb-action-link').click(); // Fill out content cy.umbracoEditorHeaderName('ContentPickerContent'); cy.get('.umb-node-preview-add').click(); @@ -590,6 +588,7 @@ context('Content', () => { cy.umbracoSuccessNotification().should('be.visible'); // Assert + cy.log('Checking that content is rendered correctly.') const expectedContent = '

Acceptance test

' cy.umbracoVerifyRenderedViewContent('contentpickercontent', expectedContent, true).should('be.true'); // clean