Skip to content

Commit 04e62e8

Browse files
committed
- update TaxonomyFieldTest
1 parent 09a6168 commit 04e62e8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/wpunit/FieldTypes/TaxonomyFieldTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function testQueryTaxononomyFieldOnBlock() {
104104
if ( ! defined( 'WPGRAPHQL_CONTENT_BLOCKS_DIR' ) ) {
105105
$this->markTestSkipped( 'This test is skipped when WPGraphQL Content Blocks is not active' );
106106
}
107-
107+
108108
acf_register_block_type([
109109
'name' => 'block_with_category_field',
110110
'title' => 'Block with Category Field',
@@ -255,7 +255,7 @@ interfaces {
255255
]);
256256

257257
$content = '
258-
<!-- wp:acf/block-with-category-field {"name":"acf/block-with-category-field","data":{"' . $field_key . '":["' . $category_id . '", "' . $category_2_id . '"]},"align":"","mode":"edit"} /-->
258+
<!-- wp:acf/block-with-category-field {"name":"acf/block-with-category-field","data":{"' . $field_key . '":[' . $category_id . ', ' . $category_2_id . ']},"align":"","mode":"edit"} /-->
259259
';
260260

261261
$post_id = self::factory()->post->create([
@@ -282,10 +282,11 @@ interfaces {
282282
'__typename' => 'Category',
283283
'databaseId' => $category_id,
284284
], 0 ),
285-
$this->expectedNode( 'blockTaxonomyTest.category.nodes', [
286-
'__typename' => 'Category',
287-
'databaseId' => $category_2_id,
288-
], 0 ),
285+
// Only the first node will be returned because the taxonomy field is set to "multiple: 0" so ACF will only return a single value
286+
// $this->expectedNode( 'blockTaxonomyTest.category.nodes', [
287+
// '__typename' => 'Category',
288+
// 'databaseId' => $category_2_id,
289+
// ], 1 ),
289290
], 0 ),
290291
]);
291292

0 commit comments

Comments
 (0)