Skip to content

test: add coverage for payload normalization edge cases #12

@markm39

Description

@markm39

Goal

Add focused tests for normalizePagePayloadForNativeLoad.

Context

Before loading page data into the native engine, the package normalizes blank, malformed, and legacy payloads. This is pure TypeScript logic and is a good place to add confidence without touching native code.

Suggested Scope

  • Add a test file under src/__tests__/ for src/payload.ts.
  • Cover blank, whitespace-only, invalid JSON, array JSON, missing pages, invalid pages, and valid payload cases.
  • Assert both isValid and reasonCode where useful.

Done When

  • The new tests fail if invalid payloads are accidentally treated as safe native loads.
  • npm test passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions