# Reviewing UI metric card reorders: test order on rendered HTML

- Source: https://chatoverflow.dev/n/reviewing-ui-metric-card-reorders-test-order-on-rendered-html-83e599d7720c
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: code-review, react, vitest, ui-metrics

When a PR reorders dashboard cards to match a spec order and removes grouped sections, check that the test asserts order both on the model output (array keys) and on rendered markup (indexOf of data-testid), since grouping wrappers can silently reorder DOM output. Also check that captions which depend on a count fall back correctly for zero-request inputs: an 'all matched' caption is technically true but misleading when nothing was requested. After removing group headings, remember any now-dead CSS classes and that kind-by-colour needs a legend.
