-
-
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.
- Loading branch information
Showing
7 changed files
with
265 additions
and
145 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
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
2 changes: 1 addition & 1 deletion
2
resources/views/specific/bootstrap-4/simple-pagination.blade.php
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
79 changes: 79 additions & 0 deletions
79
tests/Traits/Visuals/Themed/Bootstrap4/BS4PaginationVisualsTest.php
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,79 @@ | ||
<?php | ||
|
||
namespace Rappasoft\LaravelLivewireTables\Tests\Traits\Visuals\Themed\Bootstrap4; | ||
|
||
use Livewire\Livewire; | ||
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException; | ||
use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\{PetsTable}; | ||
use Rappasoft\LaravelLivewireTables\Tests\Traits\Visuals\Themed\ThemedTestCase; | ||
|
||
final class BS4PaginationVisualsTest extends ThemedTestCase | ||
{ | ||
protected function setupBasicTableForBrowsing() | ||
{ | ||
return $this->setupBasicTableForLivewire() | ||
->call('setTheme', 'bootstrap-4'); | ||
} | ||
|
||
protected function setupBasicTableSingleRecord() | ||
{ | ||
return $this->setupSingleRecordBasicTable() | ||
->call('setTheme', 'bootstrap-4'); | ||
} | ||
|
||
|
||
public function test_pagination_shows_by_default(): void | ||
{ | ||
$this->setupBasicTableSingleRecord() | ||
->assertSeeHtml('<nav role="navigation" aria-label="Pagination Navigation">') | ||
->assertSeeHtml('<ul class="pagination">'); | ||
} | ||
|
||
public function test_per_page_shows_by_default(): void | ||
{ | ||
$this->setupBasicTableForBrowsing() | ||
->assertSeeHtml('<select wire:model.live="perPage" id="table-perPage" class="form-control">'); | ||
} | ||
|
||
public function test_detailed_pagination_is_displayed_standard_bs4(): void | ||
{ | ||
$this->tableWithStandardDetailedPagination() | ||
->assertSeeHtmlInOrder([ | ||
'<div class="col-12 col-md-6 text-center text-md-right text-muted">', | ||
'<span>Showing</span>', | ||
'<strong>1</strong>', | ||
'<span>to</span>', | ||
'<span>of</span>', | ||
]); | ||
} | ||
|
||
public function test_detailed_pagination_is_displayed_simple_bs4(): void | ||
{ | ||
$this->tableWithSimpleDetailedPagination() | ||
->assertSeeHtmlInOrder([ | ||
'<div class="col-12 col-md-6 overflow-auto">', | ||
'<span>Showing</span>', | ||
'<strong>1</strong>', | ||
'<span>to</span>', | ||
]) | ||
->assertDontSeeHtml('<span>of</span>'); | ||
} | ||
|
||
public function test_detailed_pagination_is_not_displayed_standard_bs4(): void | ||
{ | ||
$this->setupBasicTableForBrowsing() | ||
->call('disableDetailedPagination', 'standard') | ||
->assertDontSeeHtml('<span>Showing</span>') | ||
->assertDontSeeHtml('<span>to</span>') | ||
->assertDontSeeHtml('<span>of</span>'); | ||
} | ||
|
||
public function test_detailed_pagination_is_not_displayed_simple_bs4(): void | ||
{ | ||
$this->setupBasicTableForBrowsing() | ||
->call('disableDetailedPagination', 'simple') | ||
->assertDontSeeHtml('<span>Showing</span>') | ||
->assertDontSeeHtml('<span>to</span>'); | ||
} | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
tests/Traits/Visuals/Themed/Bootstrap5/BS5PaginationVisualsTest.php
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,80 @@ | ||
<?php | ||
|
||
namespace Rappasoft\LaravelLivewireTables\Tests\Traits\Visuals\Themed\Bootstrap5; | ||
|
||
use Livewire\Livewire; | ||
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException; | ||
use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\{PetsTable}; | ||
use Rappasoft\LaravelLivewireTables\Tests\Traits\Visuals\Themed\ThemedTestCase; | ||
|
||
final class BS5PaginationVisualsTest extends ThemedTestCase | ||
{ | ||
|
||
protected function setupBasicTableForBrowsing() | ||
{ | ||
return $this->setupBasicTableForLivewire() | ||
->call('setTheme', 'bootstrap-5'); | ||
} | ||
|
||
protected function setupBasicTableSingleRecord() | ||
{ | ||
return $this->setupSingleRecordBasicTable() | ||
->call('setTheme', 'bootstrap-5'); | ||
} | ||
|
||
public function test_pagination_shows_by_default(): void | ||
{ | ||
$this->setupBasicTableSingleRecord() | ||
->assertSeeHtml('<nav role="navigation" aria-label="Pagination Navigation">') | ||
->assertSeeHtml('<ul class="pagination">'); | ||
} | ||
|
||
public function test_per_page_shows_by_default(): void | ||
{ | ||
$this->setupBasicTableForBrowsing() | ||
->assertSeeHtml('<select wire:model.live="perPage" id="table-perPage" class="form-select">'); | ||
} | ||
|
||
|
||
public function test_detailed_pagination_is_displayed_standard_bs5(): void | ||
{ | ||
$this->tableWithStandardDetailedPagination() | ||
->assertSeeHtmlInOrder([ | ||
'<div class="col-12 col-md-6 text-center text-md-end text-muted">', | ||
'<span>Showing</span>', | ||
'<strong>1</strong>', | ||
'<span>to</span>', | ||
'<span>of</span>', | ||
]); | ||
} | ||
|
||
public function test_detailed_pagination_is_displayed_simple(): void | ||
{ | ||
$this->tableWithSimpleDetailedPagination() | ||
->assertSeeHtmlInOrder([ | ||
'<div class="col-12 col-md-6 text-center text-md-end text-muted">', | ||
'<span>Showing</span>', | ||
'<strong>1</strong>', | ||
'<span>to</span>', | ||
]) | ||
->assertDontSeeHtml('<span>of</span>'); | ||
} | ||
|
||
public function test_detailed_pagination_is_not_displayed_standard_bs5(): void | ||
{ | ||
$this->setupBasicTableForBrowsing() | ||
->call('disableDetailedPagination', 'standard') | ||
->assertDontSeeHtml('<span>Showing</span>') | ||
->assertDontSeeHtml('<span>to</span>') | ||
->assertDontSeeHtml('<span>of</span>'); | ||
} | ||
|
||
public function test_detailed_pagination_is_not_displayed_simple_bs5(): void | ||
{ | ||
$this->setupBasicTableForBrowsing() | ||
->call('disableDetailedPagination', 'simple') | ||
->assertDontSeeHtml('<span>Showing</span>') | ||
->assertDontSeeHtml('<span>to</span>'); | ||
} | ||
|
||
} |
Oops, something went wrong.