mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Follow-up cleanup for #11184 — removes redundant test setup calls that the `@vue-nodes` fixture now handles. ## Changes - **What**: Remove 40 lines of redundant `setSetting`, `setup()`, and `waitForNodes()` calls across 11 test files - `UseNewMenu: 'Top'` calls (already fixture default) - `setup()` + `waitForNodes()` on default workflow (fixture already does this for `@vue-nodes`) - Page reload in `subgraphZeroUuid` (fixture applies VueNodes.Enabled server-side before navigation) ## Review Focus Each removal was verified against the fixture's `setupSettings()` defaults (ComfyPage.ts:420-442) and the `@vue-nodes` auto-setup (lines 454-456). Tests that call `setup()`/`waitForNodes()` after `loadWorkflow()` or `page.evaluate()` were intentionally kept. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11195-test-remove-redundant-setup-settings-now-handled-by-vue-nodes-fixture-3416d73d36508154827df116a97e9130) by [Unito](https://www.unito.io) Co-authored-by: Amp <amp@ampcode.com>
83 lines
2.5 KiB
TypeScript
83 lines
2.5 KiB
TypeScript
import {
|
|
comfyExpect as expect,
|
|
comfyPageFixture as test
|
|
} from '@e2e/fixtures/ComfyPage'
|
|
|
|
test.describe('Vue Node Collapse', { tag: '@vue-nodes' }, () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.EnableTooltips', true)
|
|
})
|
|
|
|
test('should allow collapsing node with collapse icon', async ({
|
|
comfyPage
|
|
}) => {
|
|
const vueNode = await comfyPage.vueNodes.getFixtureByTitle('KSampler')
|
|
await expect(vueNode.root).toBeVisible()
|
|
|
|
// Initially should not be collapsed
|
|
const body = vueNode.body
|
|
await expect(body).toBeVisible()
|
|
const expandedBoundingBox = await vueNode.boundingBox()
|
|
if (!expandedBoundingBox)
|
|
throw new Error('Failed to get node bounding box before collapse')
|
|
|
|
// Collapse the node
|
|
await vueNode.toggleCollapse()
|
|
await comfyPage.nextFrame()
|
|
|
|
// Verify node content is hidden
|
|
await expect(body).toBeHidden()
|
|
await expect
|
|
.poll(async () => (await vueNode.boundingBox())?.height)
|
|
.toBeLessThan(expandedBoundingBox.height)
|
|
|
|
// Expand again
|
|
await vueNode.toggleCollapse()
|
|
await comfyPage.nextFrame()
|
|
await expect(body).toBeVisible()
|
|
|
|
// Size should be restored
|
|
await expect
|
|
.poll(async () => (await vueNode.boundingBox())?.height)
|
|
.toBeGreaterThanOrEqual(expandedBoundingBox.height)
|
|
})
|
|
|
|
test('should show collapse/expand icon state', async ({ comfyPage }) => {
|
|
const vueNode = await comfyPage.vueNodes.getFixtureByTitle('KSampler')
|
|
await expect(vueNode.root).toBeVisible()
|
|
|
|
// Check initial expanded state icon
|
|
await expect(vueNode.collapseIcon).not.toHaveClass(/-rotate-90/)
|
|
|
|
// Collapse and check icon
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.collapseIcon).toHaveClass(/-rotate-90/)
|
|
|
|
// Expand and check icon
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.collapseIcon).not.toHaveClass(/-rotate-90/)
|
|
})
|
|
|
|
test('should preserve title when collapsing/expanding', async ({
|
|
comfyPage
|
|
}) => {
|
|
const vueNode = await comfyPage.vueNodes.getFixtureByTitle('KSampler')
|
|
await expect(vueNode.root).toBeVisible()
|
|
|
|
// Set custom title
|
|
await vueNode.setTitle('Test Sampler')
|
|
await expect(vueNode.title).toHaveText('Test Sampler')
|
|
|
|
// Collapse
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.title).toHaveText('Test Sampler')
|
|
|
|
// Expand
|
|
await vueNode.toggleCollapse()
|
|
await expect(vueNode.title).toHaveText('Test Sampler')
|
|
|
|
// Verify title is still displayed
|
|
await expect(vueNode.header).toContainText('Test Sampler')
|
|
})
|
|
})
|