Skip to content

Commit 3005545

Browse files
committed
Add more tests for action groups
1 parent 2fdfb24 commit 3005545

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/Controller/ActionGroupsCrudControllerTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@ public function testEntityActionGroupsInIndexPage(): void
256256
});
257257
static::assertFalse($hasGroup6, 'Category 0 should not display Action Group 6');
258258
}
259+
260+
// test that action URLs are different for each entity (verifies __clone() works correctly)
261+
if ($entityRows->count() >= 2) {
262+
$firstRowActionLinks = $entityRows->eq(0)->filter('.dropdown-submenu .dropdown-item[data-action-name]');
263+
$secondRowActionLinks = $entityRows->eq(1)->filter('.dropdown-submenu .dropdown-item[data-action-name]');
264+
265+
if ($firstRowActionLinks->count() > 0 && $secondRowActionLinks->count() > 0) {
266+
$firstUrl = $firstRowActionLinks->first()->attr('href');
267+
$secondUrl = $secondRowActionLinks->first()->attr('href');
268+
269+
static::assertNotSame($firstUrl, $secondUrl, 'Action URLs should be different for each entity');
270+
}
271+
}
259272
}
260273

261274
public function testActionGroupsInDetailPage(): void

0 commit comments

Comments
 (0)