# CSV export column order test report

> Inspect a local CSV export with shifted values. Compare the headings with their expected fields and see why a row-count assertion misses the regression.

Source: https://cueapril.com/reports/csv-export-column-order
Updated: 2026-12-01
Index: https://cueapril.com/llms.txt

## Can a customer safely import the changed file into their downstream system?

The original implementation failed the “Record inserted in reverse order” check. Expected 17,Bath and observed Bath,17. The corrected implementation met both expectations on the same inputs.

The public CSV columns remain id, city in that order. Compare two versions of a small, runnable fixture. The inputs, expected values and recorded results are public.

## What the control case missed

Both records have the same data but their object keys were inserted in different orders. Building a row from the object's values silently swaps the ID and city while leaving the CSV syntactically valid.

Observed values from the two implementations

| Check | Expected | Original | Corrected |
| --- | --- | --- | --- |
| Record in schema order | 17,Bath | 17,Bath | 17,Bath |
| Record inserted in reverse order | 17,Bath | Bath,17 | 17,Bath |

## What to check before merging

Serialize fields by the declared header order and parse the output in the test. This case isolates column order. Quoting, embedded newlines and spreadsheet formula handling each need a separate fixture.

## Reproduce the recorded result

Download the [Node.js fixture](/examples/qa-regressions/run.mjs) and run node run.mjs csv-export-column-order with Node.js 24. Compare the printed JSON with the [recorded results](/examples/qa-regressions/results.json). This is a locally executed model of the regression, using synthetic inputs. It covers the rule shown here. Hosted runs, browser behaviour and customer PRs require their own evidence.

## Primary documentation

- [Runnable synthetic regression fixtures](/examples/qa-regressions/run.mjs)
- [Recorded output for all twelve fixtures](/examples/qa-regressions/results.json)

By Cue April. Updated 2026-12-01.

## Related

- [Worked test reports](https://cueapril.com/reports): Replay a real mobile pricing defect from a Cue April pull request. Explore runnable reports for checkout, search, data migrations and other regressions.
- [Pull request testing](https://cueapril.com/use-cases/pull-request-testing): See what a pull request test report should show before you merge. Follow a failing checkout check through the fix and inspect a real PR report.
