[PR #262] [CLOSED] test: Add comprehensive React test suite with SolidJS feature parity #1186

Closed
opened 2026-03-14 09:22:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/262
Author: @zenyr
Created: 11/4/2025
Status: Closed

Base: mainHead: test/add-react-test


📝 Commits (7)

  • 885fad8 feat: add React testing utilities for CLI renderer
  • 878dda2 test: add basic text rendering tests for React
  • f721795 test: add control flow tests for React
  • bca4819 test: add layout & styling tests for React
  • 264aa95 test: add event handling tests for React
  • 048fbf3 test: add textarea and CJK grapheme rendering tests
  • 78e85b1 merge: integrate main's code style with layout test improvements and verify all tests pass

📊 Changes

10 files changed (+924 additions, -53 deletions)

View changed files

packages/react/src/testing.ts (+37 -0)
packages/react/tests/control-flow.test.tsx (+208 -0)
packages/react/tests/events.test.tsx (+91 -0)
packages/react/tests/grapheme/cjk/count-pattern.test.tsx (+32 -0)
packages/react/tests/grapheme/cjk/debug-bytes.test.tsx (+45 -0)
packages/react/tests/grapheme/cjk/hex-dump.test.tsx (+41 -0)
packages/react/tests/grapheme/cjk/punctuation-test.test.tsx (+40 -0)
📝 packages/react/tests/layout.test.tsx (+0 -53)
packages/react/tests/simple-pattern.test.tsx (+50 -0)
packages/react/tests/textarea.test.tsx (+380 -0)

📄 Description

Summary

Adds comprehensive test coverage to React reconciler with feature parity to SolidJS tests. 6 logical commits covering testing utilities, rendering, control flow, layout, events, and CJK grapheme rendering analysis. (effectively supersedes #256 albeit different)

Test Results

29 pass ✅
91 skip ⊘ (pre-existing CJK grapheme bugs or unimplemented React components)
0 fail ✅

Coverage

  • Basic text & multiline rendering
  • Conditional rendering (&&, ternary)
  • List rendering with .map()
  • Flexbox layout (row/column, flex-grow)
  • Dimensions (width, height, padding, margin)
  • Positioning (absolute, overflow)
  • Alignment (justify-content, align-items)
  • Mouse events (onMouseEnter, onMouseLeave)
  • Select component events

Commits

  1. React testing utilities (testRender, captureCharFrame)
  2. Basic text rendering tests (2 pass)
  3. Control flow tests (9 pass)
  4. Layout & styling tests (11 pass)
  5. Event handling tests (3 pass)
  6. Textarea and CJK grapheme tests (4 pass, 91 skip)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/262 **Author:** [@zenyr](https://github.com/zenyr) **Created:** 11/4/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `test/add-react-test` --- ### 📝 Commits (7) - [`885fad8`](https://github.com/anomalyco/opentui/commit/885fad8ab957a239d72e5dd025e953bf61de66f5) feat: add React testing utilities for CLI renderer - [`878dda2`](https://github.com/anomalyco/opentui/commit/878dda2b37b30eb9756f53a2ced6b68c8ccede58) test: add basic text rendering tests for React - [`f721795`](https://github.com/anomalyco/opentui/commit/f7217957fdd5b081fe479bd42d019e953dcfb4a5) test: add control flow tests for React - [`bca4819`](https://github.com/anomalyco/opentui/commit/bca481974cd53af5dd7c8132d26b0e82ab2ebbf1) test: add layout & styling tests for React - [`264aa95`](https://github.com/anomalyco/opentui/commit/264aa95993d0d226877216bff95cc83234195e32) test: add event handling tests for React - [`048fbf3`](https://github.com/anomalyco/opentui/commit/048fbf3b18c8935a74a378359a8c34b6243282f4) test: add textarea and CJK grapheme rendering tests - [`78e85b1`](https://github.com/anomalyco/opentui/commit/78e85b115bf0e237cfcf07f07534d3385c5dd67f) merge: integrate main's code style with layout test improvements and verify all tests pass ### 📊 Changes **10 files changed** (+924 additions, -53 deletions) <details> <summary>View changed files</summary> ➕ `packages/react/src/testing.ts` (+37 -0) ➕ `packages/react/tests/control-flow.test.tsx` (+208 -0) ➕ `packages/react/tests/events.test.tsx` (+91 -0) ➕ `packages/react/tests/grapheme/cjk/count-pattern.test.tsx` (+32 -0) ➕ `packages/react/tests/grapheme/cjk/debug-bytes.test.tsx` (+45 -0) ➕ `packages/react/tests/grapheme/cjk/hex-dump.test.tsx` (+41 -0) ➕ `packages/react/tests/grapheme/cjk/punctuation-test.test.tsx` (+40 -0) 📝 `packages/react/tests/layout.test.tsx` (+0 -53) ➕ `packages/react/tests/simple-pattern.test.tsx` (+50 -0) ➕ `packages/react/tests/textarea.test.tsx` (+380 -0) </details> ### 📄 Description ## Summary Adds comprehensive test coverage to React reconciler with feature parity to SolidJS tests. 6 logical commits covering testing utilities, rendering, control flow, layout, events, and CJK grapheme rendering analysis. (effectively supersedes #256 albeit different) ## Test Results ``` 29 pass ✅ 91 skip ⊘ (pre-existing CJK grapheme bugs or unimplemented React components) 0 fail ✅ ``` ## Coverage - Basic text & multiline rendering - Conditional rendering (&&, ternary) - List rendering with .map() - Flexbox layout (row/column, flex-grow) - Dimensions (width, height, padding, margin) - Positioning (absolute, overflow) - Alignment (justify-content, align-items) - Mouse events (onMouseEnter, onMouseLeave) - Select component events ## Commits 1. React testing utilities (testRender, captureCharFrame) 2. Basic text rendering tests (2 pass) 3. Control flow tests (9 pass) 4. Layout & styling tests (11 pass) 5. Event handling tests (3 pass) 6. Textarea and CJK grapheme tests (4 pass, 91 skip) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:22:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1186
No description provided.