Canvas AI: Add layout fixtures and automated tests for the Canvas AI page builder agent
## Goal Create automated tests for the Canvas AI agents, so the manual testing otherwise needed every time an agent's system prompt changes can be avoided. ## Scope This issue was originally scoped to cover both the page builder agent and the template builder agent. It is now narrowed to the **page builder agent** alone. Tests for the template builder agent will follow in a separate issue. ## What has been done so far This builds on the earlier steps toward that coverage: - #3579681 — added the `canvas_ai_agents_test` module and the framework that validates the YAML output produced by the page builder and template builder agents. - #3582390 — added tests for the Canvas AI orchestrator agent. - #3591516 — restricted the component catalog to `canvas_test_sdc` so the list of available components is identical for everyone running the tests. - #3591591 — added layout-fixture support (`LayoutFixtureSubscriber`) so sub-agent tests can run against a realistic current layout, and made the sub-agent response mock orchestrator-only. ## What this issue does With that infrastructure in place, this issue adds the test material for the page builder agent: - **Layout fixtures** — three JSON files under `fixtures/page_layout/` (`empty-page-with-content-region-enabled`, `non-empty-page-with-content-region-enabled`, `page-with-multiple-regions`). Each represents a real layout the Canvas chat UI sends from the client to the back end, so the agent is tested against page states it actually sees in use. - **20 tests** (`test_drupal_canvas_page_builder_agent_test_group.yaml`) — realistic user prompts that assert the page builder agent generates the expected `set_component_structure` output: correct component IDs and props, placement (`target` / `reference_uuid` / `placement`), region resolution, selected-component handling, image-default and enum discipline, and the non-existent-component guard. ## Follow-up - Tests for the Canvas AI template builder agent — to be created. --- _This issue description was written with AI assistance._
issue