From 401fa7334bf3e524e80b4e4e7a2167a611d51ac7 Mon Sep 17 00:00:00 2001 From: Andreas Zerbst <73799582+andr317c@users.noreply.github.com> Date: Mon, 15 May 2023 08:04:16 +0200 Subject: [PATCH] Fixed: an block grid editor accceptance test on the pipeline for v12 (#14240) * The attribute we asserted on has been changed which failed our test. The test is updated to match with the correct url * Updated so we use encodeURI instead of replacing the values in the path --- .../Content/blockGridEditorAdvanced.spec.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts index 87b19b8776..8db631019b 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorAdvanced.spec.ts @@ -44,7 +44,7 @@ test.describe('BlockGridEditorAdvancedContent', () => { await umbracoApi.media.ensureNameNotExists(customViewItemName); const imageData = await umbracoApi.media.createImageWithFile(imageName, umbracoFileValue, imageFileName, imagePath, imageMimeType); - + const customViewData = await umbracoApi.media.createFileWithFile(customViewItemName, customViewFileName, customViewPath, customViewMimeType); const customViewMediaPath = customViewData.mediaLink; @@ -101,7 +101,7 @@ test.describe('BlockGridEditorAdvancedContent', () => { await umbracoUi.navigateToContent(blockGridName); // Assert - // Checks if the block has the correct CustomView + // Checks if the block has the correct CustomView await expect(page.locator('[data-content-element-type-key="' + element['key'] + '"]').locator('[view="' + customViewMediaPath + '"]')).toBeVisible(); // Checks if the custom view updated the block by locating a name in the customView await expect(page.locator('[data-content-element-type-key="' + element['key'] + '"]').locator('[view="' + customViewMediaPath + '"]').locator('[name="BlockGridCustomView"]')).toBeVisible(); @@ -137,7 +137,7 @@ test.describe('BlockGridEditorAdvancedContent', () => { await umbracoApi.content.createDefaultContentWithABlockGridEditor(umbracoApi, element, dataType, null); await umbracoUi.navigateToContent(blockGridName); - + // Assert // Checks if the block has the correct template await expect(page.locator('umb-block-grid-entry', {hasText: elementName}).locator('umb-block-grid-block')).toHaveAttribute('stylesheet', stylesheetDataPath); @@ -345,11 +345,12 @@ test.describe('BlockGridEditorAdvancedContent', () => { // Assert // Checks if the element has the thumbnail - await expect(page.locator('umb-block-card', {hasText: elementName}).locator('.__showcase')).toHaveAttribute('style', 'background-image: url("' + imageDataPath + '?width=400");'); + const updatedImagePath = encodeURIComponent(imageDataPath); + await expect(page.locator('umb-block-card', {hasText: elementName}).locator('.__showcase')).toHaveAttribute('style', 'background-image: url("/umbraco/backoffice/umbracoapi/images/GetBigThumbnail?originalImagePath=' + updatedImagePath + '\");'); // Clean await umbracoApi.documentTypes.ensureNameNotExists(elementTwoName); await umbracoApi.media.ensureNameNotExists(imageName); }); }); -}); \ No newline at end of file +});