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) 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" } }, {