Log successful chart creation to avoid duplicate charts (#34651)

This commit is contained in:
Darnell Andries
2026-03-11 22:36:17 +00:00
committed by GitHub
parent 1c970aaa1a
commit 4c42b2eaf0
2 changed files with 3 additions and 5 deletions
@@ -314,14 +314,13 @@ IN_PROC_BROWSER_TEST_F(AIChatCodeExecutionToolBrowserTest, CreateLineChart) {
];
const labels = {sales: 'Sales ($)', profit: 'Profit ($)'};
chartUtil.createLineChart(data, labels);
console.log('Chart created');
)";
std::string output;
std::vector<mojom::ToolArtifactPtr> artifacts;
ExecuteCode(script, &output, &artifacts);
EXPECT_EQ(output, "Chart created");
EXPECT_EQ(output, "Chart created successfully");
ASSERT_EQ(artifacts.size(), 1u);
const auto& artifact = artifacts[0];
@@ -350,9 +349,7 @@ IN_PROC_BROWSER_TEST_F(AIChatCodeExecutionToolBrowserTest,
std::vector<mojom::ToolArtifactPtr> artifacts;
ExecuteCode(script, &output, &artifacts);
EXPECT_THAT(
output,
HasSubstr("Error: Artifact type 'unsupported_type' is not supported"));
EXPECT_EQ(output, "Error: Artifact type 'unsupported_type' is not supported");
EXPECT_TRUE(artifacts.empty());
}
@@ -51,6 +51,7 @@ const chartUtil = {
chartData.labels = labels;
}
codeExecArtifacts.push({ type: 'line_chart', content: chartData });
console.log('Chart created successfully');
}
};
)";