Skip to content

Commit

Permalink
refactor: Simplify sorting assertion by using orderBy
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithDennis committed Apr 26, 2024
1 parent f66d13a commit fcd5247
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stubs/Resource/Page/Index/Table/Column/Sort.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ it({{ DESCRIPTION }}, function (string $column) {

livewire({{ RESOURCE_LIST_CLASS }})
->sortTable($column){{ LOAD_TABLE_METHOD_IF_DEFERRED }}
->assertCanSeeTableRecords($records->sortBy($column), inOrder: true)
->assertCanSeeTableRecords({{ MODEL_SINGULAR_NAME }}::orderBy($column, 'asc')->get(), inOrder: true)
->sortTable($column, 'desc'){{ LOAD_TABLE_METHOD_IF_DEFERRED }}
->assertCanSeeTableRecords($records->sortByDesc($column), inOrder: true);
->assertCanSeeTableRecords({{ MODEL_SINGULAR_NAME }}::orderBy($column, 'desc')->get(), inOrder: true);
})->with({{ RESOURCE_TABLE_SORTABLE_COLUMNS }}){{ RESOLVED_GROUP_METHOD }};

0 comments on commit fcd5247

Please sign in to comment.