Files
filament/docs/10-testing
MerdinandDan Harrin 22fc471a80 Update 03-testing-tables.md - "Testing that a column can be sorted" (#17871)
* Issue #17817: Update 03-testing-tables.md - "Testing that a column can be sorted"

Currently, the documentation includes a flaky test as an example for sorting a column. This is because Filament sorts its table records according to the underlying database strategy.

Previously, the documentation suggested using the `sortBy()` method on the collection returned by the factory. However, this approach does not account for differences in how various databases handle sorting, which can lead to inconsistent test results.

With this commit, the documentation has been updated.
The example test now uses a stable approach that explicitly orders records through the database query, ensuring reliable behavior across different database systems.

Signed-off-by: Merdin <me@merdin.dev>

* Update 03-testing-tables.md - "Testing that a column can be sorted"

Improve query

Signed-off-by: Merdin <me@merdin.dev>

* Update 03-testing-tables.md

Change `orderBy('title', 'desc')` to `orderByDesc('title')` to improve code readability.

Signed-off-by: Merdin <me@merdin.dev>

* Update 03-testing-tables.md

Signed-off-by: Merdin <me@merdin.dev>

* Refactor post sorting in test to use query builder

Signed-off-by: Dan Harrin <git@danharrin.com>

* Fix sorting order for posts by title

Signed-off-by: Dan Harrin <git@danharrin.com>

---------

Signed-off-by: Merdin <me@merdin.dev>
Signed-off-by: Dan Harrin <git@danharrin.com>
Co-authored-by: Dan Harrin <git@danharrin.com>
2025-09-20 12:46:02 +01:00
..
2025-04-21 17:09:39 +01:00
2025-04-22 10:21:37 +01:00