trypost/tests/Feature/Mcp
Paulo Castellano cf045f2cdb Harden per-image alt text across publishers, validation, and attach paths
Publishing:
- Only send alt text for images (isImage guards on LinkedIn, X, Discord, Mastodon); never inject altText into video/document payloads.
- X sets alt via a best-effort media/metadata call so a metadata failure no longer blocks the tweet.

Validation:
- Validate media alt_text with a closure on media.*.meta so width/height/duration/slide_* survive a post update (Laravel's excludeUnvalidatedArrayKeys was stripping them).
- Add ALT_TEXT_MAX_LENGTH constant, a proper string-type error, and a localized attribute name.

Media attach (REST + MCP):
- Support per-image alt on attach-media-from-url via structured urls: [{url, alt?}] and on the MCP upload tool via an optional alt; alt is stored only for images.
- Carry submitted meta onto hosted external-URL media so alt is no longer dropped.

Composer:
- Alt-text dialog disables Save and reddens the counter over the limit, counting code points of the trimmed value to match the backend.
- Autosave shows 'Saved' only on a successful response; the lightbox alt overlay renders for images only.

Adds unit, feature, MCP, and browser tests covering every path above.
2026-07-16 13:55:33 -03:00
..
ApiKeyToolTest.php refactor: standardize MCP tool responses using API resources and enforce strict structural validation in feature tests 2026-05-03 21:34:20 -03:00
AttachMediaFromUploadToolTest.php Harden per-image alt text across publishers, validation, and attach paths 2026-07-16 13:55:33 -03:00
AttachMediaFromUrlToolTest.php Harden per-image alt text across publishers, validation, and attach paths 2026-07-16 13:55:33 -03:00
LabelToolTest.php refactor: standardize MCP tool responses using API resources and enforce strict structural validation in feature tests 2026-05-03 21:34:20 -03:00
MediaUploadFlowTest.php test(mcp): end-to-end media upload flow 2026-05-15 16:37:40 -03:00
PlatformToolTest.php feat: complete create + publish post flow via MCP and REST API 2026-05-04 08:12:28 -03:00
PostPlatformMetaToolTest.php refactor(linkedin): infer post format from media + unify account connection 2026-06-24 21:05:09 -03:00
PostPublishToolTest.php refactor(posts): centralize post editing status checks with PostStatusGuard 2026-05-21 19:27:19 -03:00
PostToolTest.php Make AspectRatio the single source for crop math; fill test gaps 2026-06-10 15:52:41 -03:00
RequestMediaUploadToolTest.php feat(mcp): RequestMediaUploadTool issues signed upload URLs 2026-05-15 16:19:03 -03:00
SignatureToolTest.php refactor: standardize MCP tool responses using API resources and enforce strict structural validation in feature tests 2026-05-03 21:34:20 -03:00
SocialAccountToolTest.php refactor: standardize MCP tool responses using API resources and enforce strict structural validation in feature tests 2026-05-03 21:34:20 -03:00
WorkspaceToolTest.php refactor: standardize MCP tool responses using API resources and enforce strict structural validation in feature tests 2026-05-03 21:34:20 -03:00