Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(headless): cover display-value readback after JSON restore #360

@gregkonush

Description

@gregkonush

Outcome

Add a focused Vitest fixture that proves a formula-backed WorkPaper keeps computed display readback after the document is exported, serialized, parsed, and restored.

Likely files

  • packages/headless/src/__tests__/initial-sheet-load.test.ts, or a new focused test under packages/headless/src/__tests__/
  • packages/headless/src/index.ts for public API names only

Suggested approach

Build a tiny workbook with WorkPaper.buildFromSheets(), edit one input with setCellContents(), read a formula cell with getCellValue() and getCellDisplayValue(), then round-trip through exportWorkPaperDocument(), serializeWorkPaperDocument(), parseWorkPaperDocument(), and createWorkPaperFromDocument().

Keep the fixture small: two sheets, one edited input, one dependent formula, and assertions that the restored workbook reports the same value and display text.

Acceptance proof

Run:

pnpm exec vitest run packages/headless/src/__tests__/initial-sheet-load.test.ts

If you add a new test file, run that file instead. The proof should include a restored formula cell whose numeric value and display value match the post-edit workbook.

Scope check

  • This should be reviewable in one sitting.
  • Do not change public APIs.
  • Do not add broad formula-engine behavior; this is a public @bilig/headless round-trip fixture only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: headlessPublic @bilig/headless WorkPaper runtime APIfirst-timers-onlyReserved for someone making their first contribution to this projectgood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions