", source, re.DOTALL
)
self.assertIsNotNone(execution_details_tag)
self.assertIn(':error="error"', execution_details_tag.group(0))
def test_execution_details_forwards_error_to_log_components(self) -> None:
source = read_source(CHAT_DIR / "ExecutionDetails.vue")
self.assertRegex(
source,
re.compile(r"defineProps<\{.*?error\?: string.*?\}>\(\)", re.DOTALL),
)
for component in LOG_COMPONENTS:
with self.subTest(component=component):
component_tag = re.search(rf"<{component}\b.*?/>", source, re.DOTALL)
self.assertIsNotNone(component_tag)
self.assertIn(':error="error"', component_tag.group(0))
def test_log_components_render_the_forwarded_error(self) -> None:
for component in LOG_COMPONENTS:
with self.subTest(component=component):
source = read_source(COMPONENT_DIR / f"{component}.vue")
error_branch = re.search(
r'\s*(.*?)\s*',
source,
re.DOTALL,
)
self.assertIsNotNone(error_branch)
self.assertIn("{{ error }}", error_branch.group(1))
def test_ai_log_renders_error_branch_and_normal_list(self) -> None:
"""Error renders via its own v-if branch; the normal list is not gated by v-else."""
source = read_source(COMPONENT_DIR / "LogWithAi.vue")
self.assertRegex(
source,
re.compile(
r'\s*\{\{ error \}\}\s*'
),
)
self.assertIn('', source)
if __name__ == "__main__":
unittest.main()