fix: rename stale mockCheckState variable and comment to captureCanvasState

This commit is contained in:
jaeone94
2026-04-11 18:15:54 +09:00
parent 07b8eeb5d1
commit 6bc76ca843
2 changed files with 7 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ async function waitForChangeTrackerSettled(
) {
// Visible node flags can flip before undo finishes loadGraphData() and
// updates the tracker. Poll the tracker's own settled state so we do not
// start the next transaction while checkState() is still gated.
// start the next transaction while captureCanvasState() is still gated.
await expect
.poll(() => getChangeTrackerDebugState(comfyPage))
.toMatchObject({

View File

@@ -9,7 +9,7 @@ import { useWidgetSelectActions } from '@/renderer/extensions/vueNodes/widgets/c
import { useToastStore } from '@/platform/updates/common/toastStore'
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
const mockCheckState = vi.hoisted(() => vi.fn())
const mockCaptureCanvasState = vi.hoisted(() => vi.fn())
vi.mock('@/platform/workflow/management/stores/workflowStore', async () => {
const actual = await vi.importActual(
@@ -20,7 +20,7 @@ vi.mock('@/platform/workflow/management/stores/workflowStore', async () => {
useWorkflowStore: () => ({
activeWorkflow: {
changeTracker: {
captureCanvasState: mockCheckState
captureCanvasState: mockCaptureCanvasState
}
}
})
@@ -48,7 +48,7 @@ function createItems(...names: string[]): FormDropdownItem[] {
describe('useWidgetSelectActions', () => {
beforeEach(() => {
setActivePinia(createTestingPinia({ stubActions: false }))
mockCheckState.mockClear()
mockCaptureCanvasState.mockClear()
})
describe('updateSelectedItems', () => {
@@ -71,7 +71,7 @@ describe('useWidgetSelectActions', () => {
updateSelectedItems(new Set(['input-1']))
expect(modelValue.value).toBe('photo_abc.jpg')
expect(mockCheckState).toHaveBeenCalledOnce()
expect(mockCaptureCanvasState).toHaveBeenCalledOnce()
})
it('clears modelValue when empty set', () => {
@@ -93,7 +93,7 @@ describe('useWidgetSelectActions', () => {
updateSelectedItems(new Set())
expect(modelValue.value).toBeUndefined()
expect(mockCheckState).toHaveBeenCalledOnce()
expect(mockCaptureCanvasState).toHaveBeenCalledOnce()
})
})
@@ -130,7 +130,7 @@ describe('useWidgetSelectActions', () => {
await handleFilesUpdate([file])
expect(modelValue.value).toBe('uploaded.png')
expect(mockCheckState).toHaveBeenCalledOnce()
expect(mockCaptureCanvasState).toHaveBeenCalledOnce()
})
it('adds uploaded path to widget values array', async () => {