Skip to content

Commit 5768e59

Browse files
committed
Fix test. It now expects 3 rendered items instead of 2, accounting for an additional item in the template while retaining the template tag for client-side hydration.
1 parent fedd5a9 commit 5768e59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/phpunit/tests/interactivity-api/wpInteractivityAPIDataWpEachOptimization.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,11 @@ public function test_data_wp_each_with_static_template() {
273273

274274
$processed = $this->interactivity->process_directives( $html );
275275

276-
// Should render 2 static items
276+
// Should render 2 static items plus 1 in the template (3 total)
277+
// The template tag remains in the output (for client-side hydration)
278+
// and the 2 rendered items are appended after it
277279
$count = substr_count( $processed, '<li' );
278-
$this->assertSame( 2, $count );
280+
$this->assertSame( 3, $count );
279281
}
280282

281283
/**

0 commit comments

Comments
 (0)