mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import {
|
|
comfyPageFixture as test,
|
|
comfyExpect as expect
|
|
} from '../../fixtures/ComfyPage'
|
|
|
|
test.describe('Assets Sidebar', { tag: '@ui' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.queue.mockHistory([
|
|
{ promptId: 'history-asset-1', status: 'success' }
|
|
])
|
|
await comfyPage.setup({ clearStorage: false })
|
|
|
|
await comfyPage.page.getByRole('button', { name: /^Assets/ }).click()
|
|
await expect(
|
|
comfyPage.page.getByRole('button', {
|
|
name: /history-asset-1\.png/i
|
|
})
|
|
).toBeVisible()
|
|
})
|
|
|
|
test('actions menu closes on scroll', async ({ comfyPage }) => {
|
|
const assetCard = comfyPage.page.getByRole('button', {
|
|
name: /history-asset-1\.png/i
|
|
})
|
|
|
|
await assetCard.hover()
|
|
await assetCard.getByRole('button', { name: /more options/i }).click()
|
|
|
|
const menuPanel = comfyPage.page.locator('.media-asset-menu-panel')
|
|
await expect(menuPanel).toBeVisible()
|
|
|
|
await comfyPage.page.evaluate(() => {
|
|
window.dispatchEvent(new Event('scroll'))
|
|
})
|
|
|
|
await expect(menuPanel).toBeHidden()
|
|
})
|
|
})
|