Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the page name to pagination links in the tailwind template #1616

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class="w-5 h-5"

<a
class="cursor-pointer relative inline-flex items-center px-2 py-2 text-sm font-medium text-pg-primary-500 dark:text-pg-primary-300 bg-white dark:bg-pg-primary-600 border border-pg-primary-300 dark:border-transparent leading-5 hover:text-pg-primary-400 focus:z-10 focus:outline-none focus:shadow-outline-blue active:bg-pg-primary-100 active:text-pg-primary-500 transition ease-in-out duration-150"
wire:click="previousPage"
wire:click="previousPage('{{ $paginator->getPageName() }}')"
rel="next"
>
<svg
Expand Down Expand Up @@ -120,7 +120,7 @@ class="select-none cursor-pointer relative inline-flex items-center px-3 py-2 -m
@if ($paginator->lastPage() - $paginator->currentPage() >= 2)
<a
class="select-none cursor-pointer relative inline-flex items-center px-2 py-2 text-sm font-medium text-pg-primary-500 dark:text-pg-primary-300 bg-white dark:bg-pg-primary-600 border border-pg-primary-300 dark:border-transparent leading-5 hover:text-pg-primary-400 focus:z-10 focus:outline-none focus:shadow-outline-blue active:bg-pg-primary-100 active:text-pg-primary-500 transition ease-in-out duration-150"
wire:click="nextPage"
wire:click="nextPage('{{ $paginator->getPageName() }}')"
rel="next"
>
<svg
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/PaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@
->livewire(DishesTable::class)
->set('setUp.footer.perPage', '4')

->assertSeeHtml('wire:click="nextPage"')
->assertSeeHtml('wire:click="nextPage(\'page\')"')
//page #2
->call('gotoPage', '2')
->assertSeeHtml('wire:click="nextPage"');
->assertSeeHtml('wire:click="nextPage(\'page\')"');

it('displays previous links "<" and "<<"')
->livewire(DishesTable::class)
->assertDontSeeHtml('wire:click="previousPage"')
->assertDontSeeHtml('wire:click="previousPage(\'page\')"')
//page #2
->call('gotoPage', '2')
->assertSeeHtml('wire:click="previousPage"');
->assertSeeHtml('wire:click="previousPage(\'page\')"');

it('searches for something that is not on the current page')
->livewire(DishesTable::class)
Expand Down
Loading