From 3ffc4fbae89dbd8e9e359f86d9407677a55d18eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 08:37:34 +0000 Subject: [PATCH 1/3] Initial plan From 8bd080328564607de10a50ab5d67abbce1dc3a88 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 08:41:35 +0000 Subject: [PATCH 2/3] fix: country label shown even if hidden via Use label toggle Co-authored-by: goranalkovic-infinum <77000136+goranalkovic-infinum@users.noreply.github.com> --- src/Blocks/components/country/country.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Blocks/components/country/country.php b/src/Blocks/components/country/country.php index 4e3f01e79..dd24fa884 100644 --- a/src/Blocks/components/country/country.php +++ b/src/Blocks/components/country/country.php @@ -157,7 +157,6 @@ class="' . esc_attr($countryClass) . '" 'fieldDisabled' => !empty($countryIsDisabled), 'fieldTypeCustom' => $countryTypeCustom ?: 'country', // phpcs:ignore WordPress.PHP.DisallowShortTernary.Found 'fieldTracking' => $countryTracking, - 'fieldHideLabel' => $countryHideLabel, 'fieldConditionalTags' => Helpers::render( 'conditional-tags', Helpers::props('conditionalTags', $attributes) From 01b5b0fc4c116a4f9fda78ae7c67fb6754eaf40f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:02:30 +0000 Subject: [PATCH 3/3] test: add E2E tests for country label visibility Co-authored-by: goranalkovic-infinum <77000136+goranalkovic-infinum@users.noreply.github.com> --- tests/e2e/field-country.test.js | 37 ++++++++++++++++ tests/e2e/playground/dataset.xml | 64 +++++++++++++++++++++++++++- tests/e2e/playground/playground.json | 4 +- 3 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 tests/e2e/field-country.test.js diff --git a/tests/e2e/field-country.test.js b/tests/e2e/field-country.test.js new file mode 100644 index 000000000..92c7cf43b --- /dev/null +++ b/tests/e2e/field-country.test.js @@ -0,0 +1,37 @@ +const { test, expect } = require('@playwright/test'); +const { + openUrl, + getFieldLabel, + getField, +} = require('./helpers'); + +const URL = 'field-country'; + +test.describe('Field country tests', () => { + test('country-default', async ({ page }) => { + await openUrl(page, URL); + const selector = 'country-default'; + const label = await getFieldLabel(page, selector); + const field = await getField(page, selector); + + await expect(field).toHaveClass(/es-field--country/); + await expect(label).toBeVisible(); + await expect(label).toHaveText('country-default'); + }); + + test('country-hide-label', async ({ page }) => { + await openUrl(page, URL); + const selector = 'country-hide-label'; + const label = await getFieldLabel(page, selector); + + await expect(label).not.toBeVisible(); + }); + + test('country-placeholder-use-label', async ({ page }) => { + await openUrl(page, URL); + const selector = 'country-placeholder-use-label'; + const label = await getFieldLabel(page, selector); + + await expect(label).not.toBeVisible(); + }); +}); diff --git a/tests/e2e/playground/dataset.xml b/tests/e2e/playground/dataset.xml index c22c01465..832827773 100644 --- a/tests/e2e/playground/dataset.xml +++ b/tests/e2e/playground/dataset.xml @@ -466,6 +466,68 @@ Commenter avatars come from G 0 - + + <![CDATA[field-country]]> + http://127.0.0.1:9400/eightshift-forms/field-country/ + Wed, 26 Nov 2025 08:53:19 +0000 + + http://127.0.0.1:9400/?post_type=eightshift-forms&p=30 + + + + + + + + + + + +]]> + + 30 + + + + + + + + + 0 + 0 + + + 0 + + + + + + + <![CDATA[field-country]]> + http://127.0.0.1:9400/field-country/ + Fri, 28 Nov 2025 16:45:01 +0000 + + http://127.0.0.1:9400/?page_id=35 + + ]]> + + 35 + + + + + + + + + 0 + 0 + + + 0 + + diff --git a/tests/e2e/playground/playground.json b/tests/e2e/playground/playground.json index a04869754..ce24e01d5 100644 --- a/tests/e2e/playground/playground.json +++ b/tests/e2e/playground/playground.json @@ -21,8 +21,8 @@ { "step": "importWxr", "file": { - "resource": "url", - "url": "https://github.com/infinum/eightshift-forms/blob/feature/tests/tests/e2e/playground/dataset.xml" + "resource": "vfs", + "path": "/wordpress/wp-content/plugins/eightshift-forms/tests/e2e/playground/dataset.xml" } }, {