fix: fetch dataset scope options from WorldQuant platform
This commit is contained in:
@@ -255,3 +255,38 @@ test("非首页排除、聊天暂存详情、遮罩逐层关闭和多尺寸", as
|
||||
await expect(fields).not.toBeVisible();
|
||||
expect(errors).toEqual([]);
|
||||
});
|
||||
|
||||
test("平台选项失败可重试,地区联动限制 Delay 和 Universe", async ({ page }) => {
|
||||
await setup(page);
|
||||
await page.getByLabel("Delay", { exact: true }).click();
|
||||
await page.getByRole("option", { name: /Delay 0/ }).click();
|
||||
await page.getByLabel("Region", { exact: true }).click();
|
||||
await page.getByRole("option", { name: /IND/ }).click();
|
||||
await expect(page.getByLabel("Universe", { exact: true })).toContainText(
|
||||
"TOP500",
|
||||
);
|
||||
await expect(page.getByLabel("Delay", { exact: true })).toContainText(
|
||||
"Delay 1",
|
||||
);
|
||||
await page.getByLabel("Delay", { exact: true }).click();
|
||||
await expect(page.getByRole("option", { name: /Delay 0/ })).toHaveCount(0);
|
||||
await page.keyboard.press("Escape");
|
||||
await page.route("**/api/v1/catalog/scopes", (route) =>
|
||||
route.fulfill({
|
||||
status: 502,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({ detail: "测试平台选项不可用" }),
|
||||
}),
|
||||
);
|
||||
await page.getByRole("button", { name: "Alpha 管理", exact: true }).click();
|
||||
await page.getByRole("button", { name: "数据集", exact: true }).click();
|
||||
await expect(page.getByText("测试平台选项不可用")).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "同步目录", exact: true }),
|
||||
).toBeDisabled();
|
||||
await page.unroute("**/api/v1/catalog/scopes");
|
||||
await page.getByRole("button", { name: "重试获取选项" }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "同步目录", exact: true }),
|
||||
).toBeEnabled();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user