-
-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PaginationVisuals - Utilise Class Inheritance for Tests
- Loading branch information
Showing
5 changed files
with
53 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Rappasoft\LaravelLivewireTables\Tests\Traits\Visuals\Themed; | ||
|
||
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException; | ||
|
||
abstract class BasePaginationVisuals extends ThemedTestCase | ||
{ | ||
abstract protected function setupBasicTableForBrowsing(); | ||
|
||
abstract protected function setupBasicTableSingleRecord(); | ||
|
||
public function pagination_shows_by_default() | ||
{ | ||
return $this->setupBasicTableForLivewire(); | ||
} | ||
|
||
public function setupSingleRecordBasicTable() | ||
{ | ||
return $this->setupBasicTableForLivewire() | ||
->call('setPerPageAccepted', [1]) | ||
->call('setPerPage', 1); | ||
} | ||
|
||
public function tableWithStandardDetailedPagination() | ||
{ | ||
return $this->setupBasicTableSingleRecord() | ||
->call('enableDetailedPagination', 'standard'); | ||
} | ||
|
||
public function tableWithSimpleDetailedPagination() | ||
{ | ||
return $this->setupBasicTableSingleRecord() | ||
->call('enableDetailedPagination', 'simple'); | ||
} | ||
|
||
public function test_per_page_dropdown_only_renders_with_accepted_values(): void | ||
{ | ||
$this->expectException(DataTableConfigurationException::class); | ||
|
||
$this->setupBasicTableForBrowsing() | ||
->call('setPerPage', 15); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters