Skip to content

Commit 02bf2f7

Browse files
committed
fixed bug in sorting test
1 parent 7bb07d3 commit 02bf2f7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/DatatableTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,14 +822,19 @@
822822
allowedSortings: $allowedSortings
823823
);
824824

825-
// $expected = $users->sortBy('id', descending: true)->toArray();
826825
$expected = $users->toArray();
826+
array_multisort( array_column($expected, "id"), SORT_DESC, $expected);
827827

828-
expect($data['data'])
829-
->toEqual($expected);
828+
expect($data)
829+
->toEqual([
830+
'data' => $expected,
831+
'meta' => [
832+
'totalRowCount' => 6
833+
]
834+
]);
830835

831836
expect($data['meta']['totalRowCount'])
832-
->toBe(3);
837+
->toBe(6);
833838
});
834839

835840
// contains: text, numeric DONE :D

0 commit comments

Comments
 (0)