From 07696631a375332c1777d7635c27309a5a9f3e92 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 07:01:19 +0000 Subject: [PATCH] Add updatedPerPageTest (#2047) * Add updatedPerPageTest * Fix styling --------- Co-authored-by: lrljoe --- tests/Unit/Traits/Helpers/PaginationHelpersTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Unit/Traits/Helpers/PaginationHelpersTest.php b/tests/Unit/Traits/Helpers/PaginationHelpersTest.php index fd4f04645..8374853bc 100644 --- a/tests/Unit/Traits/Helpers/PaginationHelpersTest.php +++ b/tests/Unit/Traits/Helpers/PaginationHelpersTest.php @@ -202,4 +202,17 @@ public function test_can_get_pagination_wrapper_attributes_bag(): void $this->assertSame((new \Illuminate\View\ComponentAttributeBag(['class' => 'text-lg', 'testval' => '123']))->getAttributes(), $this->basicTable->getPaginationWrapperAttributesBag()->getAttributes()); } + + public function test_check_updated_per_page_returns_correctly(): void + { + $rows = $this->basicTable->getRows(); + $this->basicTable->setPerPageAccepted([5, 10, 15, 25, 50]); + + $this->basicTable->setPerPage(5); + $this->assertSame(5, $this->basicTable->getPerPage()); + + $this->basicTable->updatedPerPage(15); + $this->assertSame(15, $this->basicTable->getPerPage()); + + } }