From 80a2b4c23853fa4a98a157091f5f0edc117731a8 Mon Sep 17 00:00:00 2001 From: berg Date: Sat, 27 Feb 2021 18:29:59 +0100 Subject: [PATCH] Fixed cypress test --- .../cypress/integration/Content/content.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts index c862708bbe..ecfe3e95d8 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts @@ -506,7 +506,7 @@ context('Content', () => { const pickerDocTypeName = 'Content picker doc type'; const pickerDocTypeAlias = AliasHelper.toAlias(pickerDocTypeName); const pickedDocTypeName = 'Picked content document type'; - + const pickedDocTypeAlias = AliasHelper.toAlias(pickedDocTypeName); cy.deleteAllContent(); cy.umbracoEnsureDocumentTypeNameNotExists(pickerDocTypeName); cy.umbracoEnsureTemplateNameNotExists(pickerDocTypeName); @@ -515,6 +515,7 @@ context('Content', () => { // Create the content type and content we'll be picking from. const pickedDocType = new DocumentTypeBuilder() .withName(pickedDocTypeName) + .withAlias(pickedDocTypeAlias) .withAllowAsRoot(true) .addGroup() .addTextBoxProperty() @@ -559,19 +560,13 @@ context('Content', () => { cy.saveDocumentType(pickerDocType); // Edit it the template to allow us to verify the rendered view. - cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage - @using ContentModels = Umbraco.Web.PublishedModels; + cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @{ Layout = null; + var pickedItem = Model.Picker as PickedContentDocumentType; } - @{ - IPublishedContent typedContentPicker = Model.Value("picker"); - if (typedContentPicker != null) - { -

@typedContentPicker.Value("text")

- } - }`); +

@pickedItem.Text

`); // Create content with content picker cy.get('.umb-tree-root-link').rightclick();