Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Blocks/components/country/country.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
37 changes: 37 additions & 0 deletions tests/e2e/field-country.test.js
Original file line number Diff line number Diff line change
@@ -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();
});
});
64 changes: 63 additions & 1 deletion tests/e2e/playground/dataset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,68 @@ Commenter avatars come from <a href="https://gravatar.com/" rel="nofollow ugc">G
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
</item>
</channel>
<item>
<title><![CDATA[field-country]]></title>
<link>http://127.0.0.1:9400/eightshift-forms/field-country/</link>
<pubDate>Wed, 26 Nov 2025 08:53:19 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<guid isPermaLink="false">http://127.0.0.1:9400/?post_type=eightshift-forms&#038;p=30</guid>
<description></description>
<content:encoded><![CDATA[<!-- wp:eightshift-forms/form-selector -->
<!-- wp:eightshift-forms/calculator -->
<!-- wp:eightshift-forms/country {"countryCountryFieldLabel":"country-default","countryCountryName":"country-default"} /-->

<!-- wp:eightshift-forms/country {"countryCountryFieldLabel":"","countryCountryFieldHideLabel":true,"countryCountryName":"country-hide-label"} /-->

<!-- wp:eightshift-forms/country {"countryCountryFieldLabel":"country-placeholder-use-label","countryCountryName":"country-placeholder-use-label","countryCountryUseLabelAsPlaceholder":true} /-->

<!-- wp:eightshift-forms/submit /-->
<!-- /wp:eightshift-forms/calculator -->
<!-- /wp:eightshift-forms/form-selector -->]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>30</wp:post_id>
<wp:post_date><![CDATA[2025-11-26 08:53:19]]></wp:post_date>
<wp:post_date_gmt><![CDATA[2025-11-26 08:53:19]]></wp:post_date_gmt>
<wp:post_modified><![CDATA[2025-11-26 08:53:19]]></wp:post_modified>
<wp:post_modified_gmt><![CDATA[2025-11-26 08:53:19]]></wp:post_modified_gmt>
<wp:comment_status><![CDATA[closed]]></wp:comment_status>
<wp:ping_status><![CDATA[closed]]></wp:ping_status>
<wp:post_name><![CDATA[field-country]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[eightshift-forms]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key><![CDATA[es-forms-es_forms_increment]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title><![CDATA[field-country]]></title>
<link>http://127.0.0.1:9400/field-country/</link>
<pubDate>Fri, 28 Nov 2025 16:45:01 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<guid isPermaLink="false">http://127.0.0.1:9400/?page_id=35</guid>
<description></description>
<content:encoded><![CDATA[<!-- wp:eightshift-forms/forms {"formsFormPostId":"30","formsFormPostIdRaw":{"id":30,"label":"field-country","value":30,"metadata":"calculator"}} /-->]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>35</wp:post_id>
<wp:post_date><![CDATA[2025-11-26 08:53:19]]></wp:post_date>
<wp:post_date_gmt><![CDATA[2025-11-26 08:53:19]]></wp:post_date_gmt>
<wp:post_modified><![CDATA[2025-11-26 08:53:19]]></wp:post_modified>
<wp:post_modified_gmt><![CDATA[2025-11-26 08:53:19]]></wp:post_modified_gmt>
<wp:comment_status><![CDATA[closed]]></wp:comment_status>
<wp:ping_status><![CDATA[closed]]></wp:ping_status>
<wp:post_name><![CDATA[field-country]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[page]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
</item>
</channel>
</rss>

4 changes: 2 additions & 2 deletions tests/e2e/playground/playground.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down