test(templates): verify local build uses static files, not hub API

Add E2E test that confirms local (non-cloud) builds never call
/api/hub/workflows and load templates from static index.json instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dante01yoon
2026-03-29 14:20:09 +09:00
parent c964fb365e
commit ee2d3b2e32

View File

@@ -91,6 +91,29 @@ test.describe(
expect(src).toBeTruthy()
})
test('local build uses static files, not hub API', async ({
comfyPage
}) => {
const hubRequests: string[] = []
await comfyPage.page.route('**/api/hub/workflows*', async (route) => {
hubRequests.push(route.request().url())
await route.abort()
})
const staticRequestPromise = comfyPage.page.waitForRequest(
(req) =>
req.url().includes('/templates/index') && req.url().endsWith('.json')
)
await comfyPage.command.executeCommand('Comfy.BrowseTemplates')
await expect(comfyPage.templates.content).toBeVisible()
await comfyPage.templates.expectMinimumCardCount(1)
const staticRequest = await staticRequestPromise
expect(staticRequest.url()).toContain('/templates/index')
expect(hubRequests).toHaveLength(0)
})
test('hub API mock: dialog renders hub workflow data', async ({
comfyPage
}) => {