Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion browser_tests/tests/sidebar/assets.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, mergeTests } from '@playwright/test'

import type { Asset } from '@comfyorg/ingest-types'
import type { Asset, ListAssetsResponse } from '@comfyorg/ingest-types'
import { assetApiFixture } from '@e2e/fixtures/assetApiFixture'
import { comfyPageFixture } from '@e2e/fixtures/ComfyPage'
import {
Expand Down Expand Up @@ -148,6 +148,63 @@
}
}

test.describe('Assets sidebar remote flag lifecycle', { tag: '@oss' }, () => {
test('falls back to settled history state when the flag turns off', async ({
comfyPage,
page
}) => {
test.setTimeout(30_000)
test.fail(
true,
'The Assets sidebar does not refresh history after a runtime flag change'
)

const assetListRequests: string[] = []
const apiAsset = {
id: 'remote-enabled-output',
name: 'remote-enabled.png',
mime_type: 'image/png',
tags: ['output'],
preview_url: '/api/view?filename=remote-enabled.png&type=output',
created_at: '2026-08-29T00:00:00.000Z',
updated_at: '2026-08-29T00:00:00.000Z'
} satisfies Asset
await page.route(/\/api\/assets(?:\?.*)?$/, async (route) => {
assetListRequests.push(route.request().url())
await route.fulfill({
json: {
assets: [apiAsset],
total: 1,
has_more: false
} satisfies ListAssetsResponse
})
})
await comfyPage.assets.mockOutputHistory([
createMockJob({ id: 'legacy-after-flag-off' })
])
await comfyPage.assets.mockInputFiles([])
await comfyPage.setup()

Check failure on line 186 in browser_tests/tests/sidebar/assets.spec.ts

View workflow job for this annotation

GitHub Actions / lint-and-format

comfy(no-comfy-page-setup-call)

browser_tests/tests/sidebar/assets.spec.ts:186:11: comfyPage.setup() already runs once per test via comfyPageFixture; calling it again re-navigates and re-clears storage, which has caused test timeouts. Configure startup with test.use({ initialSettings, initialFeatureFlags }) instead.
await comfyPage.featureFlags.setServerFlags({ assets: true })

const tab = comfyPage.menu.assetsTab
await tab.open({ waitForAssets: false })
const apiCard = tab.getAssetCardByName('remote-enabled')
await expect(apiCard).toBeVisible()
await apiCard.click()
await expect(tab.selectionFooter).toBeVisible()
const requestCountBeforeFlagOff = assetListRequests.length

await comfyPage.featureFlags.setServerFlags({ assets: false })
await expect(apiCard).toHaveCount(0)
await expect(tab.selectionFooter).toHaveCount(0)
await expect(tab.filterButton).toHaveCount(0)
expect(assetListRequests).toHaveLength(requestCountBeforeFlagOff)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
await expect(
tab.getAssetCardByName('output_legacy-after-flag-off')
).toBeVisible()
})
})

// ==========================================================================
// 1. Empty states
// ==========================================================================
Expand Down
Loading