test: #3611165 Add PHPUnit unit tests + more webship-js coverage; Penpot ecosystem docs
Adds automated test coverage and Penpot-ecosystem documentation. Issue: https://www.drupal.org/project/ai_penpot/issues/3611165. Follows on from the merged !1 (merged) (module) and !3 (merged) (docs).
PHPUnit (pure unit):
tests/src/Unit/PenpotUrlParseTest.php—PenpotContextClient::parsePenpotUrl()across every URL shape (workspace path,file-id/page-idquery,/view/, bare UUID,@-prefixed, UUID lowercasing, non-match → empty).tests/src/Unit/PenpotSummaryTest.php— the static text helpersextractText()/firstTextStyle()andsummarizeTokens()on a hand-built page (colours, typography, verbatim text, outline).
webship-js (more coverage, always-green, no live-LLM / no live-Penpot):
07settings validation — malformed / non-http(s) URL rejected with the module's error; a validhttps://saves cleanly.08field help + menu — help text mentions/api/rpc/command, Access tokens andenable-access-tokens; the AI Penpot menu link sits under the AI configuration group.09accessibility — labelled form fields, landmarks, a singleh1, no JS errors.
Docs: a "Penpot tools & ecosystem" section on the Penpot-on-DDEV page — penpot-export (design tokens → CSS/SCSS/JSON), penpotqa (Penpot's Playwright QA suite), penpot-ai-kit (AI skills over the MCP), plus penpot / penpot-mcp / penpot-helm / penpot-admin / plugins / penpot-files.
Runs in the existing CI phpunit + webship-js jobs — no .gitlab-ci.yml change.
By: Natshah This includes contributions generated with the assistance of AI (Claude).
Checkpoints
- File an issue about this project
- Addition/Change/Update/Fix to this project
- Testing to ensure no regression
- Automated unit/functional testing coverage
- Developer Documentation support on feature change/addition
- User Guide Documentation support on feature change/addition
- UX/UI designer responsibilities
- Accessibility and Readability
- Reviewed by a human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Update Release Notes
- Release
Edited by Rajab Natshah