|
@@ -120,3 +120,31 @@ test("header actions stay aligned when the more menu opens", async ({ page }) =>
|
|
|
expect(await box(more)).toEqual(before.more)
|
|
expect(await box(more)).toEqual(before.more)
|
|
|
expect(await page.getByText("刷新历史会话", { exact: true }).count()).toBe(0)
|
|
expect(await page.getByText("刷新历史会话", { exact: true }).count()).toBe(0)
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+test("wide layout keeps messages, header and composer on one reading axis", async ({ page }) => {
|
|
|
|
|
+ await page.setViewportSize({ width: 1707, height: 1019 })
|
|
|
|
|
+ await page.goto("/e2e/paas/index.html")
|
|
|
|
|
+ await page.getByLabel("平台地址", { exact: true }).fill("https://research.example")
|
|
|
|
|
+ await page.getByLabel("API Key", { exact: true }).fill("test-only")
|
|
|
|
|
+ await page.getByRole("button", { name: "连接平台", exact: true }).click()
|
|
|
|
|
+ await page.getByRole("textbox", { name: "消息", exact: true }).waitFor()
|
|
|
|
|
+ const box = async (selector: string) => {
|
|
|
|
|
+ const value = await page.locator(selector).boundingBox()
|
|
|
|
|
+ return (
|
|
|
|
|
+ value && {
|
|
|
|
|
+ x: Math.round(value.x),
|
|
|
|
|
+ width: Math.round(value.width),
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const header = await box(".paas-chat-header")
|
|
|
|
|
+ const content = await box(".paas-chat-messages > div")
|
|
|
|
|
+ const composer = await box(".paas-composer")
|
|
|
|
|
+ expect(content).toEqual(header)
|
|
|
|
|
+ expect(composer).toEqual(header)
|
|
|
|
|
+ expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBe(1707)
|
|
|
|
|
+ await page.getByRole("textbox", { name: "消息", exact: true }).fill("分析材料并制定研究计划")
|
|
|
|
|
+ await page.getByRole("button", { name: "发送消息", exact: true }).click()
|
|
|
|
|
+ await page.getByRole("button", { name: "同意并继续", exact: true }).waitFor()
|
|
|
|
|
+ expect(await box(".paas-notifications")).toEqual(header)
|
|
|
|
|
+})
|