mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Audit all skipped/fixme tests: delete stale tests whose underlying features were removed, re-enable tests that pass with minimal fixes, and remove orphaned production code that only the deleted tests exercised. Net result: **−2,350 lines** across 50 files. ## Changes - **Pruned stale skipped tests** (entire files deleted): - `LGraph.configure.test.ts`, `LGraph.constructor.test.ts` — tested removed LGraph constructor paths - `LGraphCanvas.ghostAutoPan.test.ts`, `LGraphCanvas.linkDragAutoPan.test.ts`, `useAutoPan.test.ts`, `useSlotLinkInteraction.autoPan.test.ts` — tested removed auto-pan feature - `useNodePointerInteractions.test.ts` — single skipped test for removed callback - `ImageLightbox.test.ts` — component replaced by `MediaLightbox` - `appModeWidgetRename.spec.ts` (E2E) — feature removed; helper `AppModeHelper.ts` also deleted - `domWidget.spec.ts`, `widget.spec.ts` (E2E) — tested removed widget behavior - **Removed orphaned production code** surfaced by test pruning: - `useAutoPan.ts` — composable + 93 lines of auto-pan logic in `LGraphCanvas.ts` - `ImageLightbox.vue` — replaced by `MediaLightbox` - Auto-pan integration in `useSlotLinkInteraction.ts` and `useNodeDrag.ts` - Dead settings (`LinkSnapping.AutoPanSpeed`, `LinkSnapping.AutoPanMargin`) in `coreSettings.ts` and `useLitegraphSettings.ts` - Unused subgraph methods (`SubgraphNode.getExposedInput`, `SubgraphInput.getParentInput`) - Dead i18n key, dead API schema field, dead fixture exports (`dirtyTest`, `basicSerialisableGraph`) - Dead test utility `litegraphTestUtils.ts` - **Re-enabled skipped tests with minimal fixes**: - `useBrowserTabTitle.test.ts` — removed skip, test passes as-is - `eventUtils.test.ts` — replaced MSW dependency with direct `fetch` mock - `SubscriptionPanel.test.ts` — stabilized button selectors, timezone-safe date assertion - `LinkConnector.test.ts` — removed stale describe blocks, kept passing suite - `widgetUtil.test.ts` — removed skipped tests for deleted functionality - `comfyManagerStore.test.ts` — removed skipped `isPackInstalling` / `action buttons` / `loading states` blocks - **Re-enabled then re-skipped 3 flaky E2E tests** (fail in CI for pre-existing reasons): - `browserTabTitle.spec.ts` — canvas click timeout (element not visible) - `groupNode.spec.ts` — screenshot diff (stale golden image) - `nodeSearchBox.spec.ts` — `p-dialog-mask` intercepts pointer events - **Simplified production code** alongside test cleanup: - `useNodeDrag.ts` — removed auto-pan integration, simplified from 170→100 lines - `DropZone.vue` — refactored URL-drop handling, removed unused code path - `ToInputFromIoNodeLink.ts`, `SubgraphInputEventMap.ts` — removed dead subgraph wiring - **Dependencies**: none - **Breaking**: none (all removed code was internal/unused) ## Review Focus - Confirm deleted production code (`useAutoPan`, `ImageLightbox`, subgraph methods) has no remaining callers - Validate that simplified `useNodeDrag.ts` preserves drag behavior without auto-pan - Check that re-skipped E2E tests have clear skip reasons for future triage ## Screenshots (if applicable) N/A --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: github-actions <github-actions@github.com>
62 lines
2.0 KiB
TypeScript
62 lines
2.0 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
import type { WorkspaceStore } from '../types/globals'
|
|
|
|
test.describe('Browser tab title', { tag: '@smoke' }, () => {
|
|
test.describe('Beta Menu', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
|
|
})
|
|
|
|
test('Can display workflow name', async ({ comfyPage }) => {
|
|
const workflowName = await comfyPage.page.evaluate(async () => {
|
|
return (window.app!.extensionManager as WorkspaceStore).workflow
|
|
.activeWorkflow?.filename
|
|
})
|
|
await expect
|
|
.poll(() => comfyPage.page.title())
|
|
.toBe(`*${workflowName} - ComfyUI`)
|
|
})
|
|
|
|
test('Can display workflow name with unsaved changes', async ({
|
|
comfyPage
|
|
}) => {
|
|
const workflowName = `test-${Date.now()}`
|
|
await comfyPage.menu.topbar.saveWorkflow(workflowName)
|
|
await expect
|
|
.poll(() => comfyPage.page.title())
|
|
.toBe(`${workflowName} - ComfyUI`)
|
|
|
|
await comfyPage.page.evaluate(async () => {
|
|
const node = window.app!.graph!.nodes[0]
|
|
node.pos[0] += 50
|
|
window.app!.graph!.setDirtyCanvas(true, true)
|
|
;(
|
|
window.app!.extensionManager as WorkspaceStore
|
|
).workflow.activeWorkflow?.changeTracker?.checkState()
|
|
})
|
|
await expect
|
|
.poll(() => comfyPage.page.title())
|
|
.toBe(`*${workflowName} - ComfyUI`)
|
|
|
|
// Delete the saved workflow for cleanup.
|
|
await comfyPage.page.evaluate(async () => {
|
|
return (
|
|
window.app!.extensionManager as WorkspaceStore
|
|
).workflow.activeWorkflow?.delete()
|
|
})
|
|
})
|
|
})
|
|
|
|
test.describe('Legacy Menu', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
})
|
|
|
|
test('Can display default title', async ({ comfyPage }) => {
|
|
await expect.poll(() => comfyPage.page.title()).toBe('ComfyUI')
|
|
})
|
|
})
|
|
})
|