mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Add the first user-centric Playwright coverage for the assets sidebar empty state and introduce a small assets-specific test helper/page object surface. ## Changes - **What**: add `AssetsSidebarTab`, add `AssetsHelper`, and cover generated/imported empty states in a dedicated browser spec ## Review Focus This is intentionally a small first slice for assets-sidebar coverage. The new helper still mocks the HTTP boundary in Playwright for now because current OSS job history and input files are global backend state, which makes true backend-seeded parallel coverage a separate backend change. Long-term recommendation: add backend-owned, user-scoped test seeding for jobs/history and input assets so browser tests can hit the real routes on a shared backend. Follow-up: COM-307. Fixes COM-306 ## Screenshots (if applicable) Not applicable. ## Validation - `pnpm typecheck:browser` - `pnpm exec playwright test browser_tests/tests/sidebar/assets.spec.ts --project=chromium` against an isolated preview env ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10595-test-add-assets-sidebar-empty-state-coverage-3306d73d365081d1b34fdd146ae6c5c6) by [Unito](https://www.unito.io)
31 lines
838 B
TypeScript
31 lines
838 B
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../../fixtures/ComfyPage'
|
|
|
|
test.describe('Assets sidebar', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.assets.mockEmptyState()
|
|
await comfyPage.setup()
|
|
})
|
|
|
|
test.afterEach(async ({ comfyPage }) => {
|
|
await comfyPage.assets.clearMocks()
|
|
})
|
|
|
|
test('Shows empty-state copy for generated and imported tabs', async ({
|
|
comfyPage
|
|
}) => {
|
|
const tab = comfyPage.menu.assetsTab
|
|
|
|
await tab.open()
|
|
|
|
await expect(tab.emptyStateTitle('No generated files found')).toBeVisible()
|
|
await expect(tab.emptyStateMessage).toBeVisible()
|
|
|
|
await tab.importedTab.click()
|
|
|
|
await expect(tab.emptyStateTitle('No imported files found')).toBeVisible()
|
|
await expect(tab.emptyStateMessage).toBeVisible()
|
|
})
|
|
})
|