Skip to content

Commit 9f6ab9a

Browse files
committed
fix: address test lint issues
Amp-Thread-ID: https://ampcode.com/threads/T-01a026eb-f557-7408-a5ff-0c4446293b33
1 parent 0900bca commit 9f6ab9a

17 files changed

Lines changed: 10 additions & 34 deletions

src/components/rightSidePanel/parameters/WidgetActions.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const i18n = createI18n({
9090
describe('WidgetActions', () => {
9191
beforeEach(() => {
9292
setActivePinia(createTestingPinia({ stubActions: false }))
93-
vi.resetAllMocks()
9493
mockIsFavorited.mockReturnValue(false)
9594
mockGetInputSpecForWidget.mockReturnValue({
9695
type: 'INT',

src/lib/litegraph/src/LGraphCanvas.drawConnections.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ describe('drawConnections', () => {
7676
let canvasElement: HTMLCanvasElement
7777

7878
beforeEach(() => {
79-
vi.clearAllMocks()
8079
setActivePinia(createTestingPinia({ stubActions: false }))
8180

8281
canvasElement = document.createElement('canvas')

src/lib/litegraph/src/LGraphNode.ownCollectionFields.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { beforeEach, describe, expect, it } from 'vitest'
44

55
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
66

7-
87
const COLLECTIONS = ['inputs', 'outputs', 'widgets'] as const
98

109
/** `node.hasOwnProperty(key)`, without tripping no-prototype-builtins. */

src/lib/litegraph/src/LGraphNode.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,10 +798,6 @@ describe('snapToGrid', () => {
798798
setActivePinia(createTestingPinia({ stubActions: false }))
799799
})
800800

801-
afterEach(() => {
802-
vi.restoreAllMocks()
803-
})
804-
805801
function addedNode(graph: LGraph) {
806802
const node = new LGraphNode('test')
807803
node.pos = [103, 97]

src/lib/litegraph/src/LLink.store.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createTestingPinia } from '@pinia/testing'
22
import { setActivePinia } from 'pinia'
3-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
3+
import { beforeEach, describe, expect, it, vi } from 'vitest'
44
import { computed } from 'vue'
55

66
import { LGraph, LGraphNode, LLink } from '@/lib/litegraph/src/litegraph'
@@ -19,7 +19,6 @@ import {
1919

2020
describe('LLink ↔ linkStore integration', () => {
2121
beforeEach(() => setActivePinia(createTestingPinia({ stubActions: false })))
22-
afterEach(() => vi.restoreAllMocks())
2322

2423
it('preserves the id and reactive state of a registered link', () => {
2524
const graph = new LGraph()

src/lib/litegraph/src/infrastructure/createMutationView.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('createMutationView', () => {
7474
const view = createMutationView(target, { commit })
7575

7676
expect(() => view.mutateThenThrow()).toThrow('failed mutation')
77-
delete view[1]
77+
Reflect.deleteProperty(view, '1')
7878
Object.defineProperty(view, '0', { value: 4 })
7979

8080
expect(commit).toHaveBeenCalledTimes(3)

src/lib/litegraph/src/node/legacySlotLinkMutations.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
} from '@/lib/litegraph/src/interfaces'
99
import { LGraph, LGraphNode } from '@/lib/litegraph/src/litegraph'
1010

11-
1211
function connectedPair() {
1312
const graph = new LGraph()
1413
const source = new LGraphNode('Source')

src/platform/workflow/core/services/workflowService.insertWorkflow.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ function stubWorkflow(initialState: SerialisableGraph): ComfyWorkflow {
134134

135135
beforeAll(() => {
136136
LiteGraph.registerNodeType(PROBE_NODE_TYPE, InsertWorkflowProbeNode)
137+
})
138+
139+
beforeEach(() => {
137140
const canvasPrototype: {
138141
getContext(
139142
contextId: '2d',
@@ -147,7 +150,6 @@ beforeAll(() => {
147150

148151
afterAll(() => {
149152
LiteGraph.unregisterNodeType(PROBE_NODE_TYPE)
150-
vi.restoreAllMocks()
151153
})
152154

153155
describe('insertWorkflow scratch graph isolation', () => {

src/renderer/extensions/layerEditor/engine/editor/selectionMath.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ describe('floodSelectMask (GIMP scanline segment flood)', () => {
219219
)
220220
const m = floodSelectMask(src, { x: 0, y: 0 }, 0.1, false, true)!
221221
expect(m.data[0]).toBe(1)
222-
expect(m.data[0 * 5 + 4]).toBe(1)
223-
expect(m.data[0 * 5 + 2]).toBe(0)
222+
expect(m.data[4]).toBe(1)
223+
expect(m.data[2]).toBe(0)
224224
})
225225

226226
it('non-contiguous mode matches the whole image by color', () => {

src/renderer/extensions/minimap/composables/useMinimap.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ describe('useMinimap', () => {
295295
}
296296

297297
beforeEach(() => {
298-
vi.clearAllMocks()
299298
setActivePinia(createTestingPinia({ stubActions: false }))
300299
registerMockLink(1, 'node2')
301300

0 commit comments

Comments
 (0)