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

Development to Master for 3.6.0 #2174

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
01b6824
Add Tests
lrljoe Dec 16, 2024
d235860
Add Missing Test
lrljoe Dec 16, 2024
1e5d809
Add label fixes
lrljoe Dec 16, 2024
1f889cb
Fix styling
lrljoe Dec 16, 2024
493959c
Merge pull request #2130 from LowerRockLabs/AddIsSortableTestTweak
lrljoe Dec 16, 2024
4bb6b3d
Add Custom FIlter Input Attributes, Cleanup Filter Tests (#2131)
lrljoe Dec 24, 2024
ab35e6c
Enable InputAttributes for SelectFilter (#2133)
lrljoe Dec 24, 2024
eda4c5e
Tidy ComponentUtilities, Migrate ColumnSelectQueryString (#2135)
lrljoe Dec 26, 2024
c67247b
TH Fixes - Clean-up, efficiency, and Sort Icons fixes (#2140)
lrljoe Dec 31, 2024
1d991b2
Ensure Default Sorting Is Shown in Pills (#2138)
lrljoe Dec 31, 2024
660c061
Add hasCollapsedColumns as Computed (#2141)
lrljoe Dec 31, 2024
fe3abd6
Separate the Unit and Visuals Test Suites (#2144)
lrljoe Jan 4, 2025
b819109
Tidy up Blade Class Definitions (#2145)
lrljoe Jan 4, 2025
4125285
Move Filters Before Query (#2143)
lrljoe Jan 4, 2025
d17464b
Migrate Filter Code Appropriately (#2146)
lrljoe Jan 4, 2025
567b9da
Migrate Filter Status into Own Trait (#2147)
lrljoe Jan 4, 2025
15e18fb
Update PCOV Workflow (#2148)
lrljoe Jan 4, 2025
3f71383
Add configurable area test (#2149)
lrljoe Jan 5, 2025
41c0bd0
Tidy ColumnSelectHelpers & displayToolbarFilters Method (#2150)
lrljoe Jan 6, 2025
16a3590
Add SortingConfiguration Missing Test (#2151)
lrljoe Jan 6, 2025
50226f7
Add Missing Search Tests (#2152)
lrljoe Jan 6, 2025
3d279b9
Adjust SearchHelpersTest (#2153)
lrljoe Jan 6, 2025
8910778
Add test queryStringWithQueryString (#2154)
lrljoe Jan 6, 2025
940e0ac
Add missing tests (#2157)
lrljoe Jan 7, 2025
26f094b
Tidy & Improve Collapsed Columns Behaviour (#2159)
lrljoe Jan 8, 2025
f17a0d8
Tidy computed properties behaviour (#2160)
lrljoe Jan 8, 2025
2368708
Add queryStringAliasTest (#2161)
lrljoe Jan 8, 2025
a57de60
Add missing Columns Non Computed Test (#2162)
lrljoe Jan 8, 2025
6d7b59b
WithSearch Tweaks (#2163)
lrljoe Jan 8, 2025
2ecd092
Optimize Header/Footer (#2164)
lrljoe Jan 8, 2025
1d83e0e
Migrate LivewireComponentColumn methods and add some missing basic te…
lrljoe Jan 11, 2025
19b3723
Clean up Column Component View and Slot behaviours (#2169)
lrljoe Jan 11, 2025
8dc509c
Add initial tests for LivewireComponentArrayFilter (#2170)
lrljoe Jan 11, 2025
d1f6a2e
Update ChangeLog (#2171)
lrljoe Jan 11, 2025
4761dfe
Tweak tests - centralised (#2172)
lrljoe Jan 11, 2025
fe00cff
Adjustments for ComponentColumn (#2173)
lrljoe Jan 11, 2025
6598b25
Update ChangeLog
lrljoe Jan 11, 2025
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
Prev Previous commit
Next Next commit
Add SortingConfiguration Missing Test (#2151)
* Add SortingConfiguration Missing Test

* Fix styling

* Force Workflows

* Fix styling

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
  • Loading branch information
lrljoe and lrljoe authored Jan 6, 2025
commit 16a359088e0d72259e32c86f1bd446b1f829eb24
66 changes: 66 additions & 0 deletions tests/Unit/Traits/Configuration/SortingConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Tests\Unit\Traits\Configuration;

use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTable;
use Rappasoft\LaravelLivewireTables\Tests\TestCase;

final class SortingConfigurationTest extends TestCase
Expand Down Expand Up @@ -92,4 +93,69 @@ public function test_can_set_sorting_pill_status(): void

$this->assertTrue($this->basicTable->getSortingPillsStatus());
}

public function test_default_sort_applies_correctly(): void
{
$tempDesc = new class extends PetsTable
{
public function configure(): void
{
parent::configure();
$this->setSortingEnabled();
$this->setDefaultSort('name', 'desc');
}
};
$viewDesc = view('livewire-tables::datatable');

$tempDesc->boot();
$tempDesc->bootedComponentUtilities();
$tempDesc->bootedManagesFilters();
$tempDesc->bootedWithColumns();
$tempDesc->bootedWithColumnSelect();
$tempDesc->bootedWithSecondaryHeader();
$tempDesc->booted();
$tempDesc->mountManagesFilters();
$tempDesc->mountWithSorting();
$tempDesc->renderingWithColumns($viewDesc, $viewDesc->getData());
$tempDesc->renderingWithColumnSelect($viewDesc, $viewDesc->getData());
$tempDesc->renderingWithCustomisations($viewDesc, $viewDesc->getData());
$tempDesc->renderingWithData($viewDesc, $viewDesc->getData());
$tempDesc->renderingWithFooter($viewDesc, $viewDesc->getData());
$tempDesc->renderingWithReordering($viewDesc, $viewDesc->getData());
$tempDesc->renderingWithPagination($viewDesc, $viewDesc->getData());
$tempDesc->render();
$this->assertSame(['name' => 'desc'], $tempDesc->getSorts());
$this->assertSame('desc', $tempDesc->getSort('name'));

$tempAsc = new class extends PetsTable
{
public function configure(): void
{
parent::configure();
$this->setSortingEnabled();
$this->setDefaultSort('name', 'asc');
}
};
$viewAsc = view('livewire-tables::datatable');
$tempAsc->boot();
$tempAsc->bootedComponentUtilities();
$tempAsc->bootedManagesFilters();
$tempAsc->bootedWithColumns();
$tempAsc->bootedWithColumnSelect();
$tempAsc->bootedWithSecondaryHeader();
$tempAsc->booted();
$tempAsc->mountManagesFilters();
$tempAsc->mountWithSorting();
$tempAsc->renderingWithColumns($viewAsc, $viewAsc->getData());
$tempAsc->renderingWithColumnSelect($viewAsc, $viewAsc->getData());
$tempAsc->renderingWithCustomisations($viewAsc, $viewAsc->getData());
$tempAsc->renderingWithData($viewAsc, $viewAsc->getData());
$tempAsc->renderingWithFooter($viewAsc, $viewAsc->getData());
$tempAsc->renderingWithReordering($viewAsc, $viewAsc->getData());
$tempAsc->renderingWithPagination($viewAsc, $viewAsc->getData());
$tempAsc->render();
$this->assertSame(['name' => 'asc'], $tempAsc->getSorts());
$this->assertSame('asc', $tempAsc->getSort('name'));

}
}
Loading