Skip to content

Commit

Permalink
Improve batch action delete test
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 authored and VincentLanglet committed Nov 8, 2022
1 parent 077ec2b commit b797c7e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/Functional/BatchActionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@
final class BatchActionsTest extends BaseFunctionalTestCase
{
/**
* @dataProvider provideBatchActionsCases
* @dataProvider provideDeleteBatchActionCases
*/
public function testBatchActions(string $url, string $action): void
public function testDeleteBatchAction(string $url): void
{
$this->client->request(Request::METHOD_GET, $url);
$this->client->submitForm('OK', [
'all_elements' => true,
'action' => $action,
'action' => 'delete',
]);
$this->client->submitForm('Yes, execute');

self::assertSelectorTextContains('div.alert-success', 'Selected items have been successfully deleted.');
self::assertResponseIsSuccessful();
}

Expand All @@ -37,10 +38,10 @@ public function testBatchActions(string $url, string $action): void
*
* @phpstan-return iterable<array{0: string}>
*/
public static function provideBatchActionsCases(): iterable
public static function provideDeleteBatchActionCases(): iterable
{
yield 'Normal delete' => ['/admin/tests/app/book/list', 'delete'];
yield 'Joined delete' => ['/admin/tests/app/author/list', 'delete'];
yield 'More than 20 items delete' => ['/admin/tests/app/sub/list', 'delete'];
yield 'Normal delete' => ['/admin/tests/app/book/list'];
yield 'Joined delete' => ['/admin/tests/app/author/list'];
yield 'More than 20 items delete' => ['/admin/tests/app/sub/list'];
}
}

0 comments on commit b797c7e

Please sign in to comment.