Skip to content

test: add testing system, coverage, and project documentation#89

Merged
chaxus merged 19 commits into
mainfrom
test/testing-system
May 30, 2026
Merged

test: add testing system, coverage, and project documentation#89
chaxus merged 19 commits into
mainfrom
test/testing-system

Conversation

@chaxus
Copy link
Copy Markdown
Contributor

@chaxus chaxus commented May 30, 2026

Summary

  • Add complete unit test suite (Vitest + jsdom) for embed-api.ts and onlyoffice-editor.ts
  • Add E2E tests (Playwright) for embed mode activation and postMessage API round-trips
  • Export pure utility functions from onlyoffice-editor.ts for direct testing
  • Add CLAUDE.md with full project architecture guide for future contributors/AI sessions
  • Add implementation plan for Agent collaborative editing feature
  • Add .gitignore entries for coverage/, playwright-report/, test-results/, .claude/

Test coverage highlights

File Statements Functions
embed-api.ts 97% 100%
document-utils.ts 89% 100%
i18n.ts 92% 93%
onlyoffice-editor.ts ~28% ~41% (remainder requires live OnlyOffice runtime)

Test plan

  • pnpm run lint:ts — passes
  • pnpm run test:coverage — 63 unit tests, all pass, thresholds met
  • pnpm run test:e2e — 10 E2E tests, all pass

🤖 Generated with Claude Code

chaxus and others added 19 commits May 30, 2026 21:29
Cover initEmbedApi embed-mode detection, message dispatch/routing,
origin filtering, readonly mode, and requestSaveDocument edge cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
.claude/settings.json contains local absolute paths and permission
allowlists that are machine-specific and should not be committed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Export getSavedFileMimeType, getNormalizedFile, toUint8Array for direct testing
- Add unit tests: all getSavedFileMimeType/getNormalizedFile/toUint8Array branches
- Add unit tests: makeFileFromPayload File/Blob/ArrayBuffer/Uint8Array/error paths
- Add E2E tests: embed-mode activation, postMessage round-trips, embedOrigin guard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Updated markdown tables for better alignment in `2026-05-30-agent-collab-editor.md`.
- Enhanced code formatting in `embed-api.ts`, `onlyoffice-editor.ts`, and `embed-demo.html` for consistency.
- Simplified message handling in `embed-api.spec.ts` and `embed-api.test.ts` by reducing line breaks.
- Improved test assertions in `onlyoffice-editor.test.ts` for clarity.
- Adjusted HTML structure in `embed-demo.html` for better semantic organization.
@chaxus chaxus merged commit c55a282 into main May 30, 2026
3 checks passed
@chaxus chaxus deleted the test/testing-system branch May 30, 2026 15:02
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