Files
Umbraco-CMS/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/RenderingContent/RenderingContentWithNumeric.spec.ts
Andy Butland b898eb6e03 Removed population of Urls on document response model and obsoleted property (#19030)
* Removed population of Urls on document response model and obsoleted property.

* Updated readme for acceptance tests to show how to run a single test.

* Removed URLs from document models on the client-side and fixed issue with link picker stil using legacy URLs response data.

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-04-23 10:58:38 +00:00

40 lines
1.5 KiB
TypeScript

import {AliasHelper, test} from '@umbraco/playwright-testhelpers';
const contentName = 'Test Rendering Content';
const documentTypeName = 'TestDocumentTypeForContent';
const dataTypeName = 'Numeric';
const templateName = 'TestTemplateForContent';
const propertyName = 'Test Numeric';
let dataTypeData = null;
test.beforeEach(async ({umbracoApi}) => {
dataTypeData = await umbracoApi.dataType.getByName(dataTypeName);
});
test.afterEach(async ({umbracoApi}) => {
await umbracoApi.document.ensureNameNotExists(contentName);
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
await umbracoApi.template.ensureNameNotExists(templateName);
});
const numerics = [
{type: 'a positive integer', value: '1234567890'},
{type: 'a negative integer', value: '-1234567890'},
];
for (const numeric of numerics) {
test(`can render content with ${numeric.type}`, async ({umbracoApi, umbracoUi}) => {
// Arrange
const numericValue = numeric.value;
const templateId = await umbracoApi.template.createTemplateWithDisplayingStringValue(templateName, AliasHelper.toAlias(propertyName));
const contentKey = await umbracoApi.document.createPublishedDocumentWithValue(contentName, numericValue, dataTypeData.id, templateId, propertyName, documentTypeName);
const contentURL = await umbracoApi.document.getDocumentUrl(contentKey);
// Act
await umbracoUi.contentRender.navigateToRenderedContentPage(contentURL);
// Assert
await umbracoUi.contentRender.doesContentRenderValueContainText(numericValue);
});
}