From bd62d906bbe3a838ef1b81c8be1dbee0a0ae5581 Mon Sep 17 00:00:00 2001 From: claude_code Date: Fri, 26 Jun 2026 19:16:55 +0300 Subject: [PATCH] test(e2e): anchor top-level mcp comment on existing page text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the image fix in place, the mcp e2e ran through every section and failed only at the last one (comments): create_comment was hardened to require an inline "selection" (exact text to anchor on) for a top-level comment, but the test created one without a selection ("an inline 'selection' ... is required for a top-level comment"). Pass an inline selection ("Добавленный абзац.", a plain paragraph re-imported in section 5 and still present at the comments stage). The reply is unchanged: it carries a parentCommentId, so it is a reply and needs no selection. Co-Authored-By: Claude Opus 4.8 --- packages/mcp/test-e2e.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/mcp/test-e2e.mjs b/packages/mcp/test-e2e.mjs index 4680f10c..97e66b88 100644 --- a/packages/mcp/test-e2e.mjs +++ b/packages/mcp/test-e2e.mjs @@ -454,7 +454,10 @@ async function main() { // 9. comments: create / list / reply / update / check_new / delete const beforeComments = new Date(Date.now() - 1000).toISOString(); - const c1 = await client.createComment(pageId, "Первый **комментарий** с [ссылкой](https://example.com)."); + // A top-level comment requires an inline "selection": exact contiguous text + // that exists in the persisted page to anchor on. "Добавленный абзац." is a + // plain paragraph re-imported in section 5 and still present here. + const c1 = await client.createComment(pageId, "Первый **комментарий** с [ссылкой](https://example.com).", "inline", "Добавленный абзац."); check("create_comment: created", !!c1.data.id, c1.data.id); check("create_comment: markdown round-trip", c1.data.content.includes("**комментарий**"), c1.data.content); const reply = await client.createComment(pageId, "Ответ на комментарий.", "page", undefined, c1.data.id);