Skip to content

Commit

Permalink
refactor: Improve the ordering of table records in test
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithDennis committed Apr 26, 2024
1 parent 8f1c0f4 commit 5918b25
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
@@ -1,9 +1,9 @@
it({{ DESCRIPTION }}, function (string $column) {
$records = {{ MODEL_SINGULAR_NAME }}::factory(3)->create();
{{ MODEL_SINGULAR_NAME }}::factory(3)->create();

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

0 comments on commit 5918b25

Please sign in to comment.