Skip to content

Add test coverage for plugin component registration and configuration#44

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

Add test coverage for plugin component registration and configuration#44
hotlong merged 4 commits intomainfrom
copilot/design-plugin-test-cases

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 14, 2026

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
Copy link
Copy Markdown

vercel bot commented Jan 14, 2026

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
Copy link
Copy Markdown
Contributor

hotlong commented Jan 14, 2026

@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
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 14, 2026

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

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

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

Commit: cfdfca2

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Copy link
Copy Markdown
Contributor

hotlong commented Jan 15, 2026

@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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 15, 2026

@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
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