mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: rename stale mockCheckState variable and comment to captureCanvasState
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user