diff --git a/packages/pluggableWidgets/image-web/CHANGELOG.md b/packages/pluggableWidgets/image-web/CHANGELOG.md index 874df3e573..6eae03db07 100644 --- a/packages/pluggableWidgets/image-web/CHANGELOG.md +++ b/packages/pluggableWidgets/image-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We changed the default maximum height to 250 pixels for new Image widgets. Existing widgets are not affected. + ### Fixed - We fixed an issue where previews in Design and Structure modes did not respect the configured minimum and maximum image height. diff --git a/packages/pluggableWidgets/image-web/e2e/onClick.spec.js b/packages/pluggableWidgets/image-web/e2e/onClick.spec.js index 986f0f9bb9..713f62527d 100644 --- a/packages/pluggableWidgets/image-web/e2e/onClick.spec.js +++ b/packages/pluggableWidgets/image-web/e2e/onClick.spec.js @@ -5,36 +5,42 @@ test.describe("Image viewer", () => { const dynamicImage = "https://www.learningcontainer.com/wp-content/uploads/2020/08/Sample-png-Image-for-Testing.png"; + const imageButton = (page, widgetClass) => page.locator(`${widgetClass} [role='button']`); + test("triggers a Microflow on click", async ({ page }) => { await page.goto("/p/onClickMicroflow"); await waitForMendixApp(page); - await page.click(".mx-name-image1"); - const modalDialog = await page.locator(".modal-dialog"); + await imageButton(page, ".mx-name-image1").click(); + const modalDialog = page.locator(".modal-dialog"); + await expect(modalDialog).toBeVisible(); await expect(modalDialog).toContainText("You clicked this image"); }); test("triggers a Nanoflow on click", async ({ page }) => { await page.goto("/p/onClickNanoflow"); await waitForMendixApp(page); - await page.click(".mx-name-image1"); - const modalDialog = await page.locator(".modal-dialog"); + await imageButton(page, ".mx-name-image1").click(); + const modalDialog = page.locator(".modal-dialog"); + await expect(modalDialog).toBeVisible(); await expect(modalDialog).toContainText(dynamicImage); }); test("opens a Page on click", async ({ page }) => { await page.goto("/p/onClickShowPage"); await waitForMendixApp(page); - await page.click(".mx-name-image1"); - const modalDialog = await page.locator(".modal-dialog"); - const caption = await modalDialog.locator("#mxui_widget_Window_0_caption"); + await imageButton(page, ".mx-name-image1").click(); + const modalDialog = page.locator(".modal-dialog"); + await expect(modalDialog).toBeVisible(); + const caption = modalDialog.locator("#mxui_widget_Window_0_caption"); await expect(caption).toContainText("GazaLand"); }); test("shows full screen image on click", async ({ page }) => { await page.goto("/p/onClickOpenFullScreen"); await waitForMendixApp(page); - await page.click(".mx-name-imageRender1"); - const lightboxImage = await page.locator(".mx-image-viewer-lightbox img"); + await imageButton(page, ".mx-name-imageRender1").click(); + const lightboxImage = page.locator(".mx-image-viewer-lightbox img"); + await expect(lightboxImage).toBeVisible(); await expect(lightboxImage).toHaveAttribute("src", /ImageViewer\$Images\$landscape_2\.png/); }); }); diff --git a/packages/pluggableWidgets/image-web/src/Image.xml b/packages/pluggableWidgets/image-web/src/Image.xml index 5daaad62fe..f31738cc39 100644 --- a/packages/pluggableWidgets/image-web/src/Image.xml +++ b/packages/pluggableWidgets/image-web/src/Image.xml @@ -110,7 +110,7 @@