From 9b7ed2ae8b46a6dce2794371a89f593c3a9683ad Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 14 May 2026 23:25:15 +0100 Subject: [PATCH] ML-182.6: wave 6 conversion --- ...t-streaming-tests-send_update-3-blocker.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 backlog/tasks/ml-182.6 - Wave-6-Chat-component-streaming-tests-send_update-3-blocker.md diff --git a/backlog/tasks/ml-182.6 - Wave-6-Chat-component-streaming-tests-send_update-3-blocker.md b/backlog/tasks/ml-182.6 - Wave-6-Chat-component-streaming-tests-send_update-3-blocker.md new file mode 100644 index 00000000..0bcae32d --- /dev/null +++ b/backlog/tasks/ml-182.6 - Wave-6-Chat-component-streaming-tests-send_update-3-blocker.md @@ -0,0 +1,34 @@ +--- +id: ML-182.6 +title: "Wave 6: Chat component streaming tests (send_update/3 blocker)" +status: To Do +assignee: [] +created_date: "2026-05-14 22:15" +labels: + - testing + - refactoring +dependencies: [] +modified_files: + - test/music_library_web/components/chat_test.exs +parent_task_id: ML-182 +priority: medium +ordinal: 16000 +--- + +## Description + + + +The hardest file — `components/chat_test.exs` uses `Phoenix.LiveView.send_update(view.pid, Chat, [chunk: ..., done: ..., error: ...])` to drive the Chat component's internal `update/2` callback directly with streaming state tuples. This is unit-level LiveComponent testing with no PhoenixTest equivalent — PhoenixTest has no concept of LiveComponent PIDs. + +3 tests affected in "update/2 streaming state transitions" describe block: + +- "chunk clause appends to the streaming doc" +- "done clause finalizes the assistant message and clears loading" +- "error clause surfaces the error and a retry button" + +Workaround: Rewrite as integration tests through the actual SSE streaming pipeline (stub OpenAI.API to emit controlled SSE events, use `visit/2` + `assert_has/3`). + +Effort: High (4-6h). Requires understanding the SSE streaming protocol and Chat component internals. + +