Files
ComfyUI_frontend/browser_tests/tests
Christian Byrne 45ac1a7df1 refactor(browser-tests): centralize template mocking via TemplateHelper
Mirror the AssetHelper fixture pattern for template route mocking.

- Expand templateFixtures.ts with stable distribution exports
  (Cloud/Desktop/Local/Unrestricted) and a generateTemplates() bulk
  generator alongside the existing makeTemplate/mockTemplateIndex.
- Add TemplateHelper class with operator-based configuration
  (withTemplates, withCloudTemplates, withDesktopTemplates,
  withLocalTemplates, withUnrestrictedTemplates, withTemplate, withRawIndex)
  and mock()/mockIndex()/mockThumbnails()/clearMocks() that wrap
  page.route('**/templates/index.json') and
  page.route('**/templates/**.webp').
- Add templateApiFixture.ts to expose TemplateHelper as a Playwright
  fixture with automatic clearMocks() teardown.
- Migrate templateFilteringCount.spec.ts off inline page.route blocks
  to mergeTests(comfyPageFixture, templateApiFixture) and templateApi.

Fixes #11431
2026-05-01 23:50:52 -07:00
..