From c44c3088c0efd7971875c642780cc65c5986de84 Mon Sep 17 00:00:00 2001 From: bymyself Date: Thu, 6 Nov 2025 21:28:41 -0700 Subject: [PATCH] fix: Break circular dependency with shared constants file Circular dependency was caused by: - comfyPageFixture.ts importing testComfySnapToGridGridSize from ComfyPage.ts - ComfyPage.ts re-exporting comfyPageFixture Solution: - Extract testComfySnapToGridGridSize to constants.ts - Both files import from constants.ts - Only type-import ComfyPage in comfyPageFixture.ts Now clean dependency graph with no cycles. --- browser_tests/fixtures/ComfyPage.ts | 5 ++--- browser_tests/fixtures/comfyPageFixture.ts | 2 +- browser_tests/fixtures/constants.ts | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 browser_tests/fixtures/constants.ts diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 868cde55d..2febae814 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -1589,9 +1589,8 @@ export abstract class ComfyPage { } } -export const testComfySnapToGridGridSize = 50 - -// Re-export fixture from separate file to avoid circular dependencies +// Re-export shared constants and fixture +export { testComfySnapToGridGridSize } from './constants' export { comfyPageFixture } from './comfyPageFixture' const makeMatcher = function ( diff --git a/browser_tests/fixtures/comfyPageFixture.ts b/browser_tests/fixtures/comfyPageFixture.ts index bb74c4214..956fca386 100644 --- a/browser_tests/fixtures/comfyPageFixture.ts +++ b/browser_tests/fixtures/comfyPageFixture.ts @@ -2,8 +2,8 @@ import { test as base } from '@playwright/test' import { NodeBadgeMode } from '../../src/types/nodeSource' import type { ComfyPage } from './ComfyPage' -import { testComfySnapToGridGridSize } from './ComfyPage' import { ComfyMouse } from './ComfyMouse' +import { testComfySnapToGridGridSize } from './constants' import { LocalhostComfyPage } from './LocalhostComfyPage' /** diff --git a/browser_tests/fixtures/constants.ts b/browser_tests/fixtures/constants.ts new file mode 100644 index 000000000..3da3cd5a0 --- /dev/null +++ b/browser_tests/fixtures/constants.ts @@ -0,0 +1,4 @@ +/** + * Shared constants for browser tests + */ +export const testComfySnapToGridGridSize = 50