test(Table): make the status column's colour branches reachable - #452
Merged
Conversation
IgorShevchik
force-pushed
the
fix/table-status-fixture
branch
from
August 20, 2026 09:43
67aaa33 to
9f4f6da
Compare
The map handles `paid`, `failed` and `refunded`; the fixture carried `success`, `success`, `processing`, `success`, `failed`. Only `failed` was ever in the map, so four of five rows resolved to `undefined` and rendered the badge's default, and two of the three colour branches were unreachable — the five status cells rendered in two colours where the map defines three. Same shape as #420, and the same remedy: the statuses take the docs example's vocabulary, as the dates did in #448. That example is internally coherent — its `Payment` type is `'paid' | 'failed' | 'refunded'` and its rows use exactly those — which is where the map came from; only the statuses were left behind. `id`, `email` and `amount` are untouched: those are the upstream fixture and stay as they are. Mutation-tested, with a baseline to show the difference is real rather than asserted. Changing the colour on each branch: branch on main here paid 74 passed 4 failed failed 4 failed 4 failed refunded 74 passed 4 failed Two of the three were silently invisible; all three now fail. Four is the ceiling rather than a partial score: exactly two snapshots per project — `renders with columns` and `renders with meta field on columns` — render the badge at all, so no mutation of a status colour can fail more than four. On the 540 changed snapshot lines, which look out of proportion to a five-value fixture edit: 500 of them are the status as plain text, in 25 snapshots per project that pass `data` with no `columns`. TanStack derives the columns there from `Object.keys(data[0])`, so the cell is the raw string with no badge in it and every changed row is one `<td>`. Only 40 lines, in the four badge-rendering snapshots, are markup. One branch is still only half-covered and the code comment says which: `refunded` maps to `air-primary`, which is the badge theme's own default, so changing that colour fails four tests while deleting the entry fails none. Closing that needs the fixture's `status` typed as the union; tracked with the rest of that family in #454. Closes #450.
IgorShevchik
force-pushed
the
fix/table-status-fixture
branch
from
August 20, 2026 10:00
9f4f6da to
6b32747
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #450.
What was wrong
The
statuscolumn maps three keys to three colours:The fixture carried
success,success,processing,success,failed.Only
failedwas ever a key. The other four rows resolved toundefined, andB24Badgefell back to its default colour — so two of the three branches wereunreachable, and the five status cells rendered in two colours where the map
defines three.
The fix
The statuses take the docs example's vocabulary, the same remedy #448 applied
to the dates.
TableColumnSortingExample.vuetypes its rows'paid' | 'failed' | 'refunded'and uses exactly those — it is where this mapcame from; only the statuses were left behind.
id,emailandamountare untouched. Those are the upstream fixture andstay as they are — this aligns the statuses and (in #448) the dates, not the
whole row.
Evidence
Mutation-tested with a baseline, so the difference is measured rather than
asserted. Changing the colour on each branch:
mainpaidfailedrefundedTwo of the three were silently invisible; all three now fail.
Four is the ceiling, not a partial score. Exactly two snapshots per project
—
renders with columnsandrenders with meta field on columns— render thebadge at all, so no mutation of a status colour can fail more than four tests.
On the snapshot churn
540 changed lines for a five-value fixture edit looks alarming; almost none of
it is badge markup.
The 25 snapshots per project pass
datawith nocolumns, so TanStack derivesthe columns from
Object.keys(data[0])and the cell is the raw string — everychanged row there is one
<td>with a word in it.What this does not close
One branch is still only half-covered, and the code comment names it.
refundedmaps toair-primary, which issrc/theme/badge.ts's own default,so its rendered bytes are indistinguishable from an unmapped status: changing
that colour fails four tests, but deleting the
refundedentry fails none.Closing that needs the fixture's
statustyped as the union so a dropped keyis a compile error —
getValuereturnsunknownand theas stringerasesthe key set. Tracked with the rest of that family in #454.
Corrections to the first revision
Five reviewers went over this; four claims in the original write-up did not
survive.
wrong. There were three distinct markups on both sides (
style-filled+success,style-filled+processing,style-filled-alert+failedbefore). What went 2 → 3 is the number of colours.
broad. Only the statuses and the dates come from the example;
id,emailand
amountstill diverge, deliberately.changed" — wrong twice. All five rows changed, and 500 of the 540 changed
lines are not badge markup at all.
style-filled-success. They are not — 236 occurrences already exist across54 other snapshot files. Dropped.