A spreadsheet download can look successful while quietly changing the data. An identifier loses its leading zeros, a long number changes precision, or a merged header shifts values into the wrong columns.
While building Local Table Export, we made the export format and the extraction boundary explicit. Here are five test cases that are useful for any browser-to-spreadsheet tool.
1. Identifiers that look like numbers
Use an example such as 00123. Its meaning is an identifier, not a quantity. Keep the original string and make text the default column type. Let the person exporting explicitly opt a column into numeric conversion.
Our XLSX writer emits text as an inline string cell. Numeric conversion is limited to explicitly selected columns, after the header row, and uses a conservative decimal pattern. Values outside that pattern remain text. This intentionally leaves locale-specific values such as 1,234.50 for review instead of guessing their meaning.
2. Values beyond the numeric policy
Test a long digit string such as 90071992547409999. Our exporter keeps values with more than 15 digits as text even in a selected numeric column. That is a product decision to preserve the input, not a claim that arbitrary numeric values can be round-tripped safely.
The test should inspect the cell type as well as the visible value. Finding the digits somewhere in the archive is insufficient if the consumer still treats them as numeric data.
3. Formula-looking content
A webpage cell can begin with = or another character a spreadsheet application treats specially. Do not automatically turn webpage content into workbook formulas.
Our XLSX test checks that the sheet contains no formula elements. The CSV path prefixes formula-looking values with an apostrophe. That changes the exported representation, so it is a mitigation with a tradeoff; CSV behavior still needs testing in the spreadsheet applications you support.
Quoting every CSV field solves delimiter escaping. It does not, by itself, establish a column type or guarantee that a consumer will treat the field as literal text.
4. Merged headers and multiline cells
Use a fixture with both rowspan and colspan, then check the entire rectangular result. Otherwise a plausible-looking export can put an amount under the wrong heading. Define whether merged positions become blanks or repeat values, and make the behavior consistent.
Also include a cell with a line break, a comma and a double quote. Check that CSV doubles embedded quotes and preserves the line break inside the quoted field. For XLSX, verify the resulting cell after reopening the file.
5. Rendered data versus the whole dataset
A browser table exporter sees a page representation. A paginated table may have 20 visible rows out of thousands. A virtualized grid may render only part of the current viewport.
Show the captured dimensions before download. Do not label a visible-row snapshot as a complete dataset. Our first version explicitly excludes automatic pagination, PDF tables, canvas grids and embedded frames.
A practical release check
Pair structural tests with opening the generated file in the spreadsheet application your users actually use. Compare a sample identifier, a long number, a negative quantity, a multiline cell and the row count against the source. A file that downloads successfully is only the start of validation.
Disclosure: I am the builder of Local Table Export. It is a free local-processing Chrome extension, currently awaiting Chrome Web Store review. The linked page contains a demo and the version's limits. This article was prepared with AI assistance and checked against the implementation and existing test cases.
Top comments (0)