Skip to content

test: Add failing tests for clearing optional view props (#1184)#1433

Draft
mfazekas wants to merge 2 commits into
mrousavy:mainfrom
mfazekas:test/view-optional-prop-null-repro
Draft

test: Add failing tests for clearing optional view props (#1184)#1433
mfazekas wants to merge 2 commits into
mrousavy:mainfrom
mfazekas:test/view-optional-prop-null-repro

Conversation

@mfazekas

@mfazekas mfazekas commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Repro-only PR for #1184 (companion to the fix in #1432): setting an optional view prop and then clearing it (removing it, or setting it to undefined) crashes React's commit. The new harness tests fail in CI on this PR - that's the point.

Exception in HostFunction: TestView.optionalString: Value is null, expected a String
    at cloneNodeWithNewProps (native)

Adds optionalString / nullableString / optionalCallback to the existing TestView spec and on-device harness tests that set and then clear each of them. 4 of the 7 tests fail on main; with #1432 all 7 pass.

The tests live in example/__tests__/views.harness.tsx rather than getTests.ts because the bug is only reachable by rendering a view and re-rendering it with the prop removed - it needs React's commit path. The Harness workflows pick the file up on both platforms.

Checklist

  • Targets main, narrow scope.
  • Repro-only: the test fails in CI, demonstrating the bug deterministically.
  • bun specs run, generated files committed.
  • bun lint-all passes locally.
  • No existing specs or test cases removed, no unrelated refactors.
  • Conventional Commits.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nitro-docs Skipped Skipped Jul 8, 2026 1:52pm

Request Review

@mfazekas mfazekas force-pushed the test/view-optional-prop-null-repro branch from 6bf13b8 to 0641d4e Compare July 8, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant