refactor: unify data preparations and research input snapshots
Deploy production / deploy (push) Successful in 53s

This commit is contained in:
yuxuanhui
2026-09-12 01:24:02 +08:00
parent 849f86fef7
commit 394438e753
82 changed files with 4146 additions and 2076 deletions
+23 -20
View File
@@ -68,17 +68,27 @@ test("fixed input, AI approval, backtest and research source remain connected",
const fields = await (
await page.request.get(`/api/v1/catalog/datasets/TEST_FIN/fields?${params}`)
).json();
const saved = await page.request.post("/api/v1/catalog/inputs", {
headers,
data: {
scope,
dataset_id: "TEST_FIN",
collection_version: fields.collection_version,
selection: "all",
const saved = await page.request.post(
"/api/v1/data-preparations/from-dataset",
{
headers,
data: {
scope,
dataset_id: "TEST_FIN",
collection_version: fields.collection_version,
},
},
});
);
expect(saved.status()).toBe(201);
const input = await saved.json();
const preparation = await saved.json();
const input = (
await (
await page.request.post("/api/v1/data-preparations/freeze", {
headers,
data: { items: [{ id: preparation.id, version: preparation.version }] },
})
).json()
).items[0];
const conversation = await (
await page.request.post("/api/v1/ai/conversations", { headers })
).json();
@@ -96,7 +106,7 @@ test("fixed input, AI approval, backtest and research source remain connected",
page: "datasets",
catalog_scope: scope,
dataset_id: "TEST_FIN",
template_input_id: input.id,
input_snapshot_id: input.id,
},
},
},
@@ -130,17 +140,10 @@ test("fixed input, AI approval, backtest and research source remain connected",
.click();
await expect(chat).not.toBeVisible();
const inputSheet = page.getByRole("dialog", {
name: "模板输入草稿",
name: "研究输入快照",
exact: true,
});
await expect(
inputSheet.getByRole("heading", { name: "输入草稿已保存", exact: true }),
).toBeVisible();
await inputSheet
.getByRole("button", { name: "用此输入研究", exact: true })
.click();
await expect(
chat.locator(".research-ai-reference").filter({ hasText: "固定输入" }),
).toContainText(input.id);
await expect(inputSheet).toContainText("TEST_FIN_001");
await expect(inputSheet).toContainText("TEST_FIN");
expect(errors).toEqual([]);
});