Add MSW coverage for the Duo chat conversation lifecycle

What does this MR do and why?

It migrates some Duo Chat feature (Capybara) specs to MSW integration specs that are faster and more reliable. The goal is reducing flakiness of the pipeline caused by Duo Chat feature specs.

Replaces

Note

The last MR in the series !244590 (merged) will remove these Capybara specs once we can ensure equivalent coverage using MSW integration specs

Four examples from the 'user can use agentic chat' shared example:

Capybara example Replaced by
allows basic UI interactions conversation_lifecycle_spec.js
shows session ID dropdown during active chat conversation_lifecycle_spec.js
allows user to cancel mid-stream and retry cancel_and_retry_spec.js
allows user to cancel before response arrives and retry cancel_and_retry_spec.js

One assertion is stronger than the original

conversation_lifecycle_spec.js asserts the thread picked from history is the one that hydrates, with a second thread seeded to prove the selection actually matters. The Capybara version only had one thread on screen.

Verification

yarn jest:msw-integration ee/spec/frontend/msw_integration/duo_agentic_chat/

Notes

Test-only, so no changelog entry.

Part of Make Duo Agentic Chat feature specs more stable (#603605 - closed)

The MR series

# MR What it does Status
1 !248777 (merged) Sets up MSW test foundations Merged
2 !248782 (merged) Covers the AI panel shell Merged
3 !248783 Covers the chat conversation lifecycle Open — this MR
4 !248785 (merged) Covers chat tool calls Open
5 !248787 (merged) Covers agent and model selection Draft
6 !248791 (merged) Covers additional context Draft
7 !244590 (merged) Removes the replaced Capybara specs Draft

Related issue: #603605 (closed)

The four spec MRs (3-6) are independent and can be reviewed and merged in parallel, in any order. Several add helpers to the same two shared test files, so whichever merges first leaves the others a trivial rebase: inserts in the same place, never disagreements. !244590 (merged) merges last, since it deletes the Capybara coverage the others replace.

Edited by Enrique Alcántara

Merge request reports

Loading
Loading