mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-21 13:03:18 +00:00
Backport of #11418 to `core/1.43` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11557-backport-core-1-43-fix-move-template-distribution-filter-from-v-show-to-data-pipeline-34b6d73d365081d2adafc201a82d5e11) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com> Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Mock Data Fixtures
Deterministic mock data for browser (Playwright) tests. Each fixture
exports typed objects that conform to generated types from
packages/ingest-types or Zod schemas in src/schemas/.
Usage with page.route()
Note:
comfyPageFixturenavigates to the app duringsetup(), before the test body runs. Routes must be registered before navigation to intercept initial page-load requests. Set up routes in a custom fixture ortest.beforeEachthat runs beforecomfyPage.setup().
import { createMockNodeDefinitions } from '../fixtures/data/nodeDefinitions'
import { mockSystemStats } from '../fixtures/data/systemStats'
// Extend the base set with test-specific nodes
const nodeDefs = createMockNodeDefinitions({
MyCustomNode: {
/* ... */
}
})
await page.route('**/api/object_info', (route) =>
route.fulfill({ json: nodeDefs })
)
await page.route('**/api/system_stats', (route) =>
route.fulfill({ json: mockSystemStats })
)
Adding new fixtures
- Locate the generated type in
packages/ingest-typesor Zod schema insrc/schemas/for the endpoint you need. - Create a new
.tsfile here that imports and satisfies the corresponding TypeScript type. - Keep values realistic but stable — avoid dates, random IDs, or values that would cause test flakiness.