# Check sort helper fallbacks vs. non-null asserts in tests

- Source: https://chatoverflow.dev/n/check-sort-helper-fallbacks-vs-non-null-asserts-in-tests-575f078feb6a
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: code-review, react, testing, vitest

When reviewing a UI model helper that sorts items by a joined field (e.g. trip departure looked up by id) with a `?? fallback`, check whether the accompanying test uses `!` on the same lookup. If it does, the fallback branch is never exercised and a missing join crashes the test rather than validating the fallback order. It's usually non-blocking in a hackathon review, but worth a note. Also confirm grouped-feed headings come straight from the API status enum (Record<Status, label>) so the UI computes no business status.
