Skip to content

feat: add end-to-end tests for multiple-choice question handling in a… - #640

Merged
pikann merged 2 commits into
masterfrom
feature/add-e2e-tests-for-agent-multiple-choice-question
Oct 26, 2026
Merged

pikann merged 2 commits into
masterfrom
feature/add-e2e-tests-for-agent-multiple-choice-question

Conversation

@pikann

@pikann pikann commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

End-to-end coverage for the agent multiple-choice question feature merged in #639: the ask_user_question card in chat and in task/document comments, plain-text @mentions turning into mention badges, and the in-app notification for a person mentioned in a document comment.

Changes

  • apps/e2e/tests/projects/agent-questions.spec.ts — 14 Playwright tests.
  • apps/e2e/features/projects/agent-questions.feature — the matching Gherkin scenarios.

Scenarios

  • Plain-text mentions become badges (API level): @username and @Name (id: …) in task comments, and @username in document comments, are stored as real teamMention chips. Unknown names, e-mail addresses, inline code and code blocks stay plain text.
  • Document mention notification: the admin mentions a project member in a document comment; the member signs in, sees "mentioned you in document <title>" in the notification bell, and clicking it opens the document.
  • Question card in a task or document comment (each case runs for both):
    • shows the question and its options, and not the raw paca-ask payload;
    • picking an option shows "You answered: …" and stores a reply comment that mentions the asker;
    • a multi-select question collects several options ("Test 1, Test 3");
    • a free-text answer is posted as typed.
  • Question card in a chat conversation: the card is visible without expanding the "N tool calls" group, is built from the tool result when the call's input is empty (as with Goose-wrapped CLIs), and clicking an option sends it as a message.

Notes

  • The e2e stack has no LLM, so the agent side is simulated: question comments are posted over the API as the admin (so the answer's reply mentions the admin), and the chat transcript is served through a mocked events response, as conversations.spec.ts does.
  • Not covered end to end: starting an agent from a mention, and the question notification for a conversation (driven by a Valkey stream event; covered by Go unit tests in feat: add multiple-choice question handling in assistant UI #639).
  • Desktop projects only: the spec skips mobile because the activity pane and conversation layout differ on phones.

Testing

Against the e2e stack (deploy/docker-compose.e2e.yml, built from this branch):

cd apps/e2e && npx playwright test --project=chromium tests/projects/agent-questions.spec.ts

14 passed with 1 worker and with 3 workers. biome check is clean on the spec. Only the chromium project was run.

🤖 Generated with Claude Code

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one documentation gap worth closing.

Reviewed changes

  • New e2e spec (apps/e2e/tests/projects/agent-questions.spec.ts) — 14 Playwright tests covering plain-text mention linking in task/document comments, the document-mention notification, the paca-ask card in the task and document activity panes, and the chat ask card resolved from the tool result when the call's input is empty.
  • Matching Gherkin file (apps/e2e/features/projects/agent-questions.feature) — the scenario text of record; not executed by the runner in this repo.

ℹ️ The feature file under-describes the document-side card scenarios

The spec's header declares // spec: features/projects/agent-questions.feature, but the A question in a comment is shown as a card rule lists five scenarios while the spec runs eight tests — the multi-select and free-text cases are exercised for both task and doc, and only the option-pick has an explicit document scenario ("The same card works on a document"). The rule's Background ("a comment carrying a 'paca-ask' question with options 'Test 1', 'Test 2', 'Test 3' exists") also reads as pre-seeded, whereas each test posts its own comment. Since the .feature files are the spec of record here, the file will drift from what actually runs; worth adding the two document scenarios (and noting inline-code alongside the e-mail/code-block case, which the spec covers but the file does not).

Technical details
# Feature file does not describe the full card coverage

## Affected sites
- `apps/e2e/features/projects/agent-questions.feature` (card rule, new file lines ~52–81) — five scenarios; the spec runs four tests per kind for `task` and `doc`, so document-side multi-select and free-text have no scenario text.
- `apps/e2e/features/projects/agent-questions.feature` (Code blocks scenario, new file line ~39) — mentions `[email protected]` and a code block, but not the inline-code `@admin` the spec's "E-mail addresses, inline code and code blocks are left alone" test also asserts.

## Required outcome
- The `.feature` scenarios reflect every behavior the matching spec asserts, so the two stay in sync per the repo convention that specs are expected to track their feature file.

## Suggested approach (optional)
- Add document-side scenarios for the multi-select and free-text answer cases (or state that the card rule applies to both targets), and add inline code to the code-blocks/e-mail scenario.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Feature file now matches the spec 1:1 — the comment-card rule became Scenario Outlines running each case for both the task and document targets, closing the documentation gap raised in the prior review.
  • Added a note that the card is identical on a task and on a document's "Comments & activity" panel.
  • Fixed the mention rule's Background to create the project/task/document instead of implying a pre-seeded comment, and extended the e-mail/code-block scenario to cover inline code.

The prior review left only an informational body finding (no inline threads), and commit 8747cfca addresses all three parts of it. The Gherkin now covers all 14 tests — 4 mention scenarios, 1 notification, 4 outlines × 2 targets for the comment card, and 1 chat scenario.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 0c2dd8f into master Oct 26, 2026
2 checks passed
@pikann
pikann deleted the feature/add-e2e-tests-for-agent-multiple-choice-question branch October 26, 2026 10:03
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