mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-13 04:59:51 +08:00
- tests/e2e/lib: openApp(page, { path, config }), MODEL_CONFIGS_KEY,
savedModelConfigs, settingsDialog, chunkedReplies, sse() and
toolCallEvents() replace about 70 copies of goto + wait for iframe,
three local openApp functions, 14 window.fetch overrides and the
Node-side SSE serialisers; unused fixtures removed
- delete theme, save, history, model-config, upload and copy-paste
specs (the copy-button test moves to chat.spec.ts); trim
iframe-interaction, history-restore, keyboard and smoke to tests that
can fail; file-upload asserts on the preview image
- settings-review-fixes.spec.ts split by topic into settings-bedrock,
settings-tabs-sync and settings-providers
- unit tests use vi.stubEnv with unstubEnvs: true instead of
hand-written process.env save and restore loops
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import {
|
|
expect,
|
|
getIframe,
|
|
getIframeContent,
|
|
openApp,
|
|
test,
|
|
} from "./lib/fixtures"
|
|
|
|
test.describe("Iframe Interaction", () => {
|
|
test("draw.io iframe loads successfully", async ({ page }) => {
|
|
await page.goto("/", { waitUntil: "networkidle" })
|
|
|
|
const iframe = getIframe(page)
|
|
await expect(iframe).toBeVisible({ timeout: 30000 })
|
|
|
|
// iframe should have loaded draw.io content
|
|
const frame = getIframeContent(page)
|
|
await expect(frame.locator(".geDiagramContainer").first()).toBeVisible({
|
|
timeout: 30000,
|
|
})
|
|
})
|
|
|
|
test("can interact with draw.io toolbar", async ({ page }) => {
|
|
await openApp(page)
|
|
|
|
const frame = getIframeContent(page)
|
|
|
|
// Draw.io menu items should be accessible
|
|
await expect(
|
|
frame
|
|
.locator('text="Diagram"')
|
|
.or(frame.locator('[title*="Diagram"]'))
|
|
.filter({ visible: true })
|
|
.first(),
|
|
).toBeVisible({ timeout: 30000 })
|
|
})
|
|
})
|