Skip to content

Add test coverage for plugin component registration and configuration - #44

Merged
hotlong merged 4 commits into
mainfrom
copilot/design-plugin-test-cases
Jan 15, 2026
Merged

hotlong merged 4 commits into
mainfrom
copilot/design-plugin-test-cases

Conversation

Copilot AI commented Jan 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Test Cases for Plugins ✅

Completed Tasks

  • Analyze repository structure and existing test patterns
  • Create test suite for @object-ui/plugin-charts (11 tests)
  • Create test suite for @object-ui/plugin-markdown (5 tests)
  • Create test suite for @object-ui/plugin-editor (7 tests)
  • Create test suite for @object-ui/plugin-kanban (8 tests)
  • Add test scripts to plugin package.json files
  • Run all plugin tests to verify they pass (31 tests passed)
  • Code review completed (no issues found)
  • Security scan completed (no vulnerabilities found)
  • Merge main branch and resolve conflicts
  • Fix pnpm test command

Summary

Successfully fixed the pnpm test command to work correctly in the monorepo setup:

Fix Details

  • Root test script: Changed from pnpm -r test to vitest run to use the root's vitest installation
  • Added pretest script: Builds required packages (@object-ui/types, core, react, components) before running tests
  • Result: All 86 tests now pass (including 31 plugin tests + 55 existing tests)

Previous Issues

The original pnpm -r test approach tried to run each package's test script individually, but vitest was only installed at the root level, causing "vitest: not found" errors in package contexts.

Test Coverage by Plugin

  1. @object-ui/plugin-charts (11 tests) - chart-bar and advanced chart components
  2. @object-ui/plugin-markdown (5 tests) - markdown rendering component
  3. @object-ui/plugin-editor (7 tests) - Monaco code editor component
  4. @object-ui/plugin-kanban (8 tests) - kanban board component

All tests validate ComponentRegistry integration, metadata, inputs, and default props.

Original prompt

为插件设计测试用力


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel

vercel Bot commented Jan 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
objectui-playground Ready Ready Preview, Comment Jan 15, 2026 0:10am

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
@hotlong
hotlong marked this pull request as ready for review January 14, 2026 20:00
@hotlong

hotlong commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

@copilot 从主分支更新代码并解决冲突

Copilot AI changed the title [WIP] Add test cases for plugin design Add test coverage for plugin component registration and configuration Jan 14, 2026
Copilot AI requested a review from huangyiirene January 14, 2026 20:07
- Merged test and test:watch scripts with type-check and lint scripts
- Kept comprehensive test implementations over placeholder tests
- All plugin packages now have full script support

Copilot AI commented Jan 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot 从主分支更新代码并解决冲突

已完成主分支合并并解决所有冲突。合并详情:

  • 合并了 test、test:watch 与主分支的 type-check、lint 脚本
  • 保留了完整的测试实现(31个测试)而非占位符测试
  • 所有测试通过验证

Commit: cfdfca2

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive test coverage for all plugin packages in the Object UI monorepo, ensuring that plugin components are properly registered with the ComponentRegistry and have correct metadata configuration.

Changes:

  • Created test suites for 4 plugin packages with 31 total tests covering component registration, metadata, inputs, and default props
  • Added test:watch script to all plugin package.json files for development convenience
  • Tests validate ComponentRegistry integration following the established testing patterns from the components package

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/plugin-charts/src/index.test.ts Added 11 tests validating chart-bar and chart (advanced) component registration, metadata, inputs (enum, array), and default props
packages/plugin-charts/package.json Added test:watch script for development
packages/plugin-markdown/src/index.test.ts Added 5 tests validating markdown component registration, required inputs, textarea input type, and default markdown content
packages/plugin-markdown/package.json Added test:watch script for development
packages/plugin-editor/src/index.test.ts Added 7 tests validating code-editor registration, enum inputs for language/theme, boolean inputs, and default props
packages/plugin-editor/package.json Added test:watch script for development
packages/plugin-kanban/src/index.test.ts Added 8 tests validating kanban board registration, array/code inputs, default column structure, and card properties
packages/plugin-kanban/package.json Added test:watch script for development

@hotlong

hotlong commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

@copilot fix pnpm test

- Changed root test script from 'pnpm -r test' to 'vitest run'
- Added pretest script to build required packages before running tests
- Fixes issue where individual packages couldn't find vitest locally
- All 86 tests now pass successfully

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>

Copilot AI commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix pnpm test

Fixed pnpm test command. Changes:

  • Root test script now uses vitest run instead of pnpm -r test
  • Added pretest script to build dependencies before running tests
  • All 86 tests now pass successfully (including 31 plugin tests)

The issue was that pnpm -r test tried to run each package's test script individually, but vitest was only installed at root level.

Commit: 10ec2d3

@github-actions

Copy link
Copy Markdown
Contributor

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong
hotlong merged commit 5e8ff28 into main Jan 15, 2026
7 checks passed
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 9, 2026
…ne; remove the Display Mode control and seed (objectui#7654) (objectstack-ai#7739)

* feat(types)!: retire ChatbotSchema.displayMode as an ADR-0049 tombstone; drop the Display Mode control and seed (objectui#7654)

`displayMode?: 'inline' | 'floating'` was declared on `ChatbotSchema` and on
`ChatbotFloatingSchema`, offered as a "Display Mode" control in the
`chatbot-floating` registration's `inputs`, seeded as `'floating'` by that
registration's `defaultProps` -- and read by nothing. The node `type` is the
one selector of presentation; this key was a second spelling of that choice.
Maintainer ruling B (2026-09-05, decision batch objectstack-ai#44): retire it.

Both declarations become `displayMode?: never` with the JSDoc pointing at
`type` as the replacement and citing discriminator prong 2 (advertised at
CHANGELOG.md:578, 3.3.0). The designer control and the `defaultProps` seed are
removed; the restatement of the control is the tombstone plus the changeset.

Runtime validation of the key is unchanged -- zero before and after: it has no
Zod arm on either twin and `BaseSchema` is `.passthrough()`, so stored
documents the designer wrote parse exactly as they did. No `retirementTombstone()`
half is minted (that is the objectui#6152 axis); the new test pins both twins'
shapes as the tripwire that fires when the mirror is minted.

Measured on this member (tsc, `FloatingChatbotConfig` lit as the no-index-
signature control): declared, a wrong value is TS2322 and presence is clean;
DELETED, every shape is silent and the member reads as `any`; TOMBSTONED,
presence with any value is TS2322 in every shape. On a `BaseSchema` carrier the
routes are loud-vs-silent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3

* docs(types): name the manifest/validator accept-set face, and correct the tripwire prose (objectui#7654)

Text-only land-prep on the retirement PR. No runtime, type or manifest
behaviour changes: every hunk is changeset prose, a test title string, or a
comment block.

1. Clause-② / changeset — the accept-set list named the TypeScript, runtime and
   designer faces but not the manifest one. Re-measured on both sides of this
   change, with the `chatbot-floating` registration restored from `origin/main`
   for the LIVE leg (mutation and restore proven by blob hash):
   `inputs` 20 -> 19, `defaultProps` 9 keys -> 8; `validateTree` on a stored
   node carrying `displayMode` goes 0 -> 1 diagnostic, code `unknown-prop`,
   severity `warning`; the props interface `generateDts` derives from the same
   `inputs` goes 20 -> 19 members. Author-time only: `compile()` still returns a
   tree carrying the value on both legs, and the page renderer filters
   diagnostics to `severity === 'error'` before failing a page.

2. The shape-pin comment and the 7655 TRIPWIRE comment claimed the parse-green
   line stays green for a non-strict mirror arm, citing objectui#7678 item 2.
   That transposition is false: item 2 measured object-mirror shapes, and
   `displayMode` is a scalar union. Minting the arm a scalar union takes — an
   optional `z.enum` over 'inline' | 'floating' — on `ChatbotSchema`'s twin
   reddens BOTH: `tsc` with exactly one error at
   zod-mirror-parity.test.ts(1586,14) and vitest with exactly two failures, the
   shape pin and the parse-green line. The prose now says what was measured.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3

---------

Co-authored-by: Claude <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 10ec2d34 Deployed Jan 15, 2026 by vercel[bot]
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.

4 participants