mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
lint: add tsconfig for browser_tests, fix existing violations (#5633)
## Summary See https://typescript-eslint.io/blog/project-service/ for context. Creates a browser_tests specific tsconfig so that they can be linted. Does not add a package.json script to do the linting yet, but `pnpm exec eslint browser_tests` should work for now. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5633-lint-add-tsconfig-for-browser_tests-fix-existing-violations-2726d73d3650819d8ef2c4b0abc31e14) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Page, test as base } from '@playwright/test'
|
import type { Page } from '@playwright/test'
|
||||||
|
import { test as base } from '@playwright/test'
|
||||||
|
|
||||||
export class UserSelectPage {
|
export class UserSelectPage {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Locator, Page } from '@playwright/test'
|
import type { Locator, Page } from '@playwright/test'
|
||||||
|
|
||||||
export class ComfyNodeSearchFilterSelectionPanel {
|
export class ComfyNodeSearchFilterSelectionPanel {
|
||||||
constructor(public readonly page: Page) {}
|
constructor(public readonly page: Page) {}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Page } from '@playwright/test'
|
import type { Page } from '@playwright/test'
|
||||||
|
|
||||||
import { ComfyPage } from '../ComfyPage'
|
import type { ComfyPage } from '../ComfyPage'
|
||||||
|
|
||||||
export class SettingDialog {
|
export class SettingDialog {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Locator, Page } from '@playwright/test'
|
import type { Locator, Page } from '@playwright/test'
|
||||||
|
|
||||||
class SidebarTab {
|
class SidebarTab {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Locator, Page, expect } from '@playwright/test'
|
import type { Locator, Page } from '@playwright/test'
|
||||||
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
export class Topbar {
|
export class Topbar {
|
||||||
private readonly menuLocator: Locator
|
private readonly menuLocator: Locator
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ export const webSocketFixture = base.extend<{
|
|||||||
// so we can look it up to trigger messages
|
// so we can look it up to trigger messages
|
||||||
const store: Record<string, WebSocket> = ((window as any).__ws__ = {})
|
const store: Record<string, WebSocket> = ((window as any).__ws__ = {})
|
||||||
window.WebSocket = class extends window.WebSocket {
|
window.WebSocket = class extends window.WebSocket {
|
||||||
constructor() {
|
constructor(
|
||||||
// @ts-expect-error
|
...rest: ConstructorParameters<typeof window.WebSocket>
|
||||||
super(...arguments)
|
) {
|
||||||
|
super(...rest)
|
||||||
store[this.url] = this
|
store[this.url] = this
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FullConfig } from '@playwright/test'
|
import type { FullConfig } from '@playwright/test'
|
||||||
import dotenv from 'dotenv'
|
import dotenv from 'dotenv'
|
||||||
|
|
||||||
import { backupPath } from './utils/backupUtils'
|
import { backupPath } from './utils/backupUtils'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FullConfig } from '@playwright/test'
|
import type { FullConfig } from '@playwright/test'
|
||||||
import dotenv from 'dotenv'
|
import dotenv from 'dotenv'
|
||||||
|
|
||||||
import { restorePath } from './utils/backupUtils'
|
import { restorePath } from './utils/backupUtils'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Locator, Page } from '@playwright/test'
|
import type { Locator, Page } from '@playwright/test'
|
||||||
|
|
||||||
export class ManageGroupNode {
|
export class ManageGroupNode {
|
||||||
footer: Locator
|
footer: Locator
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Locator, Page } from '@playwright/test'
|
import type { Locator, Page } from '@playwright/test'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import {
|
import type {
|
||||||
TemplateInfo,
|
TemplateInfo,
|
||||||
WorkflowTemplates
|
WorkflowTemplates
|
||||||
} from '../../src/platform/workflow/templates/types/template'
|
} from '../../src/platform/workflow/templates/types/template'
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ test.describe('Actionbar', () => {
|
|||||||
|
|
||||||
// Intercept the prompt queue endpoint
|
// Intercept the prompt queue endpoint
|
||||||
let promptNumber = 0
|
let promptNumber = 0
|
||||||
comfyPage.page.route('**/api/prompt', async (route, req) => {
|
await comfyPage.page.route('**/api/prompt', async (route, req) => {
|
||||||
await new Promise((r) => setTimeout(r, 100))
|
await new Promise((r) => setTimeout(r, 100))
|
||||||
route.fulfill({
|
await route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
prompt_id: promptNumber,
|
prompt_id: promptNumber,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import type { ComfyPage } from '../fixtures/ComfyPage'
|
||||||
import {
|
import {
|
||||||
ComfyPage,
|
|
||||||
comfyExpect as expect,
|
comfyExpect as expect,
|
||||||
comfyPageFixture as test
|
comfyPageFixture as test
|
||||||
} from '../fixtures/ComfyPage'
|
} from '../fixtures/ComfyPage'
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Page, expect } from '@playwright/test'
|
import type { Page } from '@playwright/test'
|
||||||
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Locator, expect } from '@playwright/test'
|
import type { Locator } from '@playwright/test'
|
||||||
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import type { Keybinding } from '../../src/schemas/keyBindingSchema'
|
import type { Keybinding } from '../../src/schemas/keyBindingSchema'
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from '@playwright/test'
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import { SettingParams } from '../../src/platform/settings/types'
|
import type { SettingParams } from '../../src/platform/settings/types'
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.describe('Topbar commands', () => {
|
test.describe('Topbar commands', () => {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { expect } from '@playwright/test'
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import { ComfyPage, comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import type { ComfyPage } from '../fixtures/ComfyPage'
|
||||||
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
||||||
|
|
||||||
test.describe('Group Node', () => {
|
test.describe('Group Node', () => {
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { Locator, expect } from '@playwright/test'
|
import type { Locator } from '@playwright/test'
|
||||||
import { Position } from '@vueuse/core'
|
import { expect } from '@playwright/test'
|
||||||
|
import type { Position } from '@vueuse/core'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type ComfyPage,
|
type ComfyPage,
|
||||||
comfyPageFixture as test,
|
comfyPageFixture as test,
|
||||||
testComfySnapToGridGridSize
|
testComfySnapToGridGridSize
|
||||||
} from '../fixtures/ComfyPage'
|
} from '../fixtures/ComfyPage'
|
||||||
import { type NodeReference } from '../fixtures/utils/litegraphUtils'
|
import type { NodeReference } from '../fixtures/utils/litegraphUtils'
|
||||||
|
|
||||||
test.describe('Item Interaction', () => {
|
test.describe('Item Interaction', () => {
|
||||||
test('Can select/delete all items', async ({ comfyPage }) => {
|
test('Can select/delete all items', async ({ comfyPage }) => {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { expect } from '@playwright/test'
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import { ComfyPage, comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import type { ComfyPage } from '../fixtures/ComfyPage'
|
||||||
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.describe('Remote COMBO Widget', () => {
|
test.describe('Remote COMBO Widget', () => {
|
||||||
const mockOptions = ['d', 'c', 'b', 'a']
|
const mockOptions = ['d', 'c', 'b', 'a']
|
||||||
|
|||||||
@@ -160,7 +160,9 @@ test.describe.skip('Queue sidebar', () => {
|
|||||||
comfyPage
|
comfyPage
|
||||||
}) => {
|
}) => {
|
||||||
await comfyPage.nextFrame()
|
await comfyPage.nextFrame()
|
||||||
expect(comfyPage.menu.queueTab.getGalleryImage(firstImage)).toBeVisible()
|
await expect(
|
||||||
|
comfyPage.menu.queueTab.getGalleryImage(firstImage)
|
||||||
|
).toBeVisible()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('maintains active gallery item when new tasks are added', async ({
|
test('maintains active gallery item when new tasks are added', async ({
|
||||||
@@ -174,7 +176,9 @@ test.describe.skip('Queue sidebar', () => {
|
|||||||
const newTask = comfyPage.menu.queueTab.tasks.getByAltText(newImage)
|
const newTask = comfyPage.menu.queueTab.tasks.getByAltText(newImage)
|
||||||
await newTask.waitFor({ state: 'visible' })
|
await newTask.waitFor({ state: 'visible' })
|
||||||
// The active gallery item should still be the initial image
|
// The active gallery item should still be the initial image
|
||||||
expect(comfyPage.menu.queueTab.getGalleryImage(firstImage)).toBeVisible()
|
await expect(
|
||||||
|
comfyPage.menu.queueTab.getGalleryImage(firstImage)
|
||||||
|
).toBeVisible()
|
||||||
})
|
})
|
||||||
|
|
||||||
test.describe('Gallery navigation', () => {
|
test.describe('Gallery navigation', () => {
|
||||||
@@ -196,7 +200,9 @@ test.describe.skip('Queue sidebar', () => {
|
|||||||
delay: 256
|
delay: 256
|
||||||
})
|
})
|
||||||
await comfyPage.nextFrame()
|
await comfyPage.nextFrame()
|
||||||
expect(comfyPage.menu.queueTab.getGalleryImage(end)).toBeVisible()
|
await expect(
|
||||||
|
comfyPage.menu.queueTab.getGalleryImage(end)
|
||||||
|
).toBeVisible()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Page, expect } from '@playwright/test'
|
import type { Page } from '@playwright/test'
|
||||||
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from '@playwright/test'
|
import { expect } from '@playwright/test'
|
||||||
|
|
||||||
import { SystemStats } from '../../src/schemas/apiSchema'
|
import type { SystemStats } from '../../src/schemas/apiSchema'
|
||||||
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
||||||
|
|
||||||
test.describe('Version Mismatch Warnings', () => {
|
test.describe('Version Mismatch Warnings', () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
/* Test files should not be compiled */
|
/* Test files should not be compiled */
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
@@ -9,13 +9,6 @@
|
|||||||
"resolveJsonModule": true
|
"resolveJsonModule": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"*.ts",
|
"**/*.ts",
|
||||||
"*.mts",
|
|
||||||
"*.config.js",
|
|
||||||
"browser_tests/**/*.ts",
|
|
||||||
"scripts/**/*.js",
|
|
||||||
"scripts/**/*.ts",
|
|
||||||
"tests-ui/**/*.ts",
|
|
||||||
".storybook/**/*.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -153,5 +153,14 @@ export default defineConfig([
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['tests-ui/**/*'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/consistent-type-imports': [
|
||||||
|
'error',
|
||||||
|
{ disallowTypeAnnotations: false }
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { createTestingPinia } from '@pinia/testing'
|
import { createTestingPinia } from '@pinia/testing'
|
||||||
import { VueWrapper, mount } from '@vue/test-utils'
|
import type { VueWrapper } from '@vue/test-utils'
|
||||||
|
import { mount } from '@vue/test-utils'
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
import { createI18n } from 'vue-i18n'
|
import { createI18n } from 'vue-i18n'
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
} from '@/stores/comfyManagerStore'
|
} from '@/stores/comfyManagerStore'
|
||||||
import { useCommandStore } from '@/stores/commandStore'
|
import { useCommandStore } from '@/stores/commandStore'
|
||||||
import { useDialogStore } from '@/stores/dialogStore'
|
import { useDialogStore } from '@/stores/dialogStore'
|
||||||
import { TaskLog } from '@/types/comfyManagerTypes'
|
import type { TaskLog } from '@/types/comfyManagerTypes'
|
||||||
|
|
||||||
// Mock modules
|
// Mock modules
|
||||||
vi.mock('@/stores/comfyManagerStore')
|
vi.mock('@/stores/comfyManagerStore')
|
||||||
|
|||||||
@@ -2,12 +2,8 @@ import { createPinia, setActivePinia } from 'pinia'
|
|||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
|
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
|
||||||
import {
|
import type { LGraphNode, Positionable } from '@/lib/litegraph/src/litegraph'
|
||||||
LGraphEventMode,
|
import { LGraphEventMode, Reroute } from '@/lib/litegraph/src/litegraph'
|
||||||
LGraphNode,
|
|
||||||
Positionable,
|
|
||||||
Reroute
|
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
import { useManagerQueue } from '@/composables/useManagerQueue'
|
import { useManagerQueue } from '@/composables/useManagerQueue'
|
||||||
import { components } from '@/types/generatedManagerTypes'
|
import type { components } from '@/types/generatedManagerTypes'
|
||||||
|
|
||||||
// Mock dialog service
|
// Mock dialog service
|
||||||
vi.mock('@/services/dialogService', () => ({
|
vi.mock('@/services/dialogService', () => ({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { useNodeChatHistory } from '@/composables/node/useNodeChatHistory'
|
import { useNodeChatHistory } from '@/composables/node/useNodeChatHistory'
|
||||||
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
|
|
||||||
vi.mock(
|
vi.mock(
|
||||||
'@/renderer/extensions/vueNodes/widgets/composables/useChatHistoryWidget',
|
'@/renderer/extensions/vueNodes/widgets/composables/useChatHistoryWidget',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
import { useServerLogs } from '@/composables/useServerLogs'
|
import { useServerLogs } from '@/composables/useServerLogs'
|
||||||
import { LogsWsMessage } from '@/schemas/apiSchema'
|
import type { LogsWsMessage } from '@/schemas/apiSchema'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
|
|
||||||
vi.mock('@/scripts/api', () => ({
|
vi.mock('@/scripts/api', () => ({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { LinkConnector } from '@/lib/litegraph/src/litegraph'
|
|||||||
import { MovingOutputLink } from '@/lib/litegraph/src/litegraph'
|
import { MovingOutputLink } from '@/lib/litegraph/src/litegraph'
|
||||||
import { ToOutputRenderLink } from '@/lib/litegraph/src/litegraph'
|
import { ToOutputRenderLink } from '@/lib/litegraph/src/litegraph'
|
||||||
import { LGraphNode, LLink } from '@/lib/litegraph/src/litegraph'
|
import { LGraphNode, LLink } from '@/lib/litegraph/src/litegraph'
|
||||||
import { NodeInputSlot } from '@/lib/litegraph/src/litegraph'
|
import type { NodeInputSlot } from '@/lib/litegraph/src/litegraph'
|
||||||
|
|
||||||
import { createTestSubgraph } from '../subgraph/fixtures/subgraphHelpers'
|
import { createTestSubgraph } from '../subgraph/fixtures/subgraphHelpers'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, it, vi } from 'vitest'
|
import { describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { LGraphButton } from '@/lib/litegraph/src/litegraph'
|
import { LGraphButton } from '@/lib/litegraph/src/litegraph'
|
||||||
import { LGraphCanvas } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphCanvas } from '@/lib/litegraph/src/litegraph'
|
||||||
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
|
|
||||||
describe('LGraphNode Title Buttons', () => {
|
describe('LGraphNode Title Buttons', () => {
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
// TODO: Fix these tests after migration
|
// TODO: Fix these tests after migration
|
||||||
import { afterEach, describe, expect, vi } from 'vitest'
|
import { afterEach, describe, expect, vi } from 'vitest'
|
||||||
|
|
||||||
|
import type { LGraph, Reroute } from '@/lib/litegraph/src/litegraph'
|
||||||
import {
|
import {
|
||||||
type CanvasPointerEvent,
|
type CanvasPointerEvent,
|
||||||
LGraph,
|
|
||||||
LGraphNode,
|
LGraphNode,
|
||||||
LLink,
|
LLink,
|
||||||
LinkConnector,
|
LinkConnector,
|
||||||
Reroute,
|
|
||||||
type RerouteId
|
type RerouteId
|
||||||
} from '@/lib/litegraph/src/litegraph'
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { INodeInputSlot, INodeOutputSlot } from '@/lib/litegraph/src/litegraph'
|
import type {
|
||||||
|
INodeInputSlot,
|
||||||
|
INodeOutputSlot
|
||||||
|
} from '@/lib/litegraph/src/litegraph'
|
||||||
import {
|
import {
|
||||||
inputAsSerialisable,
|
inputAsSerialisable,
|
||||||
outputAsSerialisable
|
outputAsSerialisable
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
// TODO: Fix these tests after migration
|
// TODO: Fix these tests after migration
|
||||||
import { assert, describe, expect, it } from 'vitest'
|
import { assert, describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
|
import type { ISlotType, LGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
import {
|
import {
|
||||||
ISlotType,
|
|
||||||
LGraph,
|
|
||||||
LGraphGroup,
|
LGraphGroup,
|
||||||
LGraphNode,
|
LGraphNode,
|
||||||
LiteGraph
|
LiteGraph
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { describe, expect, it, vi } from 'vitest'
|
import { describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { LGraphButton } from '@/lib/litegraph/src/litegraph'
|
import { LGraphButton } from '@/lib/litegraph/src/litegraph'
|
||||||
import { LGraphCanvas } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphCanvas } from '@/lib/litegraph/src/litegraph'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createTestSubgraph,
|
createTestSubgraph,
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { LinkConnector } from '@/lib/litegraph/src/litegraph'
|
|||||||
import { ToInputFromIoNodeLink } from '@/lib/litegraph/src/litegraph'
|
import { ToInputFromIoNodeLink } from '@/lib/litegraph/src/litegraph'
|
||||||
import { SUBGRAPH_INPUT_ID } from '@/lib/litegraph/src/litegraph'
|
import { SUBGRAPH_INPUT_ID } from '@/lib/litegraph/src/litegraph'
|
||||||
import { LGraphNode, type LinkNetwork } from '@/lib/litegraph/src/litegraph'
|
import { LGraphNode, type LinkNetwork } from '@/lib/litegraph/src/litegraph'
|
||||||
import { NodeInputSlot } from '@/lib/litegraph/src/litegraph'
|
import type { NodeInputSlot } from '@/lib/litegraph/src/litegraph'
|
||||||
import { NodeOutputSlot } from '@/lib/litegraph/src/litegraph'
|
import type { NodeOutputSlot } from '@/lib/litegraph/src/litegraph'
|
||||||
import {
|
import {
|
||||||
isSubgraphInput,
|
isSubgraphInput,
|
||||||
isSubgraphOutput
|
isSubgraphOutput
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// TODO: Fix these tests after migration
|
// TODO: Fix these tests after migration
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import type { ISlotType } from '@/lib/litegraph/src/litegraph'
|
import type { ISlotType, Subgraph } from '@/lib/litegraph/src/litegraph'
|
||||||
import { LGraphNode, Subgraph } from '@/lib/litegraph/src/litegraph'
|
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import type { TWidgetType } from '@/lib/litegraph/src/litegraph'
|
import type { TWidgetType } from '@/lib/litegraph/src/litegraph'
|
||||||
import { BaseWidget } from '@/lib/litegraph/src/litegraph'
|
import { BaseWidget } from '@/lib/litegraph/src/litegraph'
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
* in their test files. Each fixture provides a clean, pre-configured subgraph
|
* in their test files. Each fixture provides a clean, pre-configured subgraph
|
||||||
* setup for different testing scenarios.
|
* setup for different testing scenarios.
|
||||||
*/
|
*/
|
||||||
import { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph'
|
import type { Subgraph } from '@/lib/litegraph/src/litegraph'
|
||||||
import { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
|
import { LGraph } from '@/lib/litegraph/src/litegraph'
|
||||||
|
import type { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
|
||||||
|
|
||||||
import { test } from '../../core/fixtures/testExtensions'
|
import { test } from '../../core/fixtures/testExtensions'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
||||||
import { NodeSearchService } from '@/services/nodeSearchService'
|
import { NodeSearchService } from '@/services/nodeSearchService'
|
||||||
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
|
import { ComfyNodeDefImpl } from '@/stores/nodeDefStore'
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
|
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
|
||||||
import { useGraphNodeManager } from '@/composables/graph/useGraphNodeManager'
|
import type { useGraphNodeManager } from '@/composables/graph/useGraphNodeManager'
|
||||||
import type { LGraphCanvas, LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphCanvas, LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
|
||||||
import { useLayoutMutations } from '@/renderer/core/layout/operations/layoutMutations'
|
import { useLayoutMutations } from '@/renderer/core/layout/operations/layoutMutations'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import axios from 'axios'
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { useRemoteWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget'
|
import { useRemoteWidget } from '@/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget'
|
||||||
import { RemoteWidgetConfig } from '@/schemas/nodeDefSchema'
|
import type { RemoteWidgetConfig } from '@/schemas/nodeDefSchema'
|
||||||
|
|
||||||
vi.mock('axios', () => {
|
vi.mock('axios', () => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import { createPinia, setActivePinia } from 'pinia'
|
import { createPinia, setActivePinia } from 'pinia'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import {
|
import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
ComfyWorkflow,
|
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
|
||||||
useWorkflowStore
|
|
||||||
} from '@/platform/workflow/management/stores/workflowStore'
|
|
||||||
|
|
||||||
vi.mock('@/renderer/core/thumbnail/graphThumbnailRenderer', () => ({
|
vi.mock('@/renderer/core/thumbnail/graphThumbnailRenderer', () => ({
|
||||||
createGraphThumbnail: vi.fn()
|
createGraphThumbnail: vi.fn()
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { nextTick, ref } from 'vue'
|
|||||||
|
|
||||||
import { useComfyManagerService } from '@/services/comfyManagerService'
|
import { useComfyManagerService } from '@/services/comfyManagerService'
|
||||||
import { useComfyManagerStore } from '@/stores/comfyManagerStore'
|
import { useComfyManagerStore } from '@/stores/comfyManagerStore'
|
||||||
import { components as ManagerComponents } from '@/types/generatedManagerTypes'
|
import type { components as ManagerComponents } from '@/types/generatedManagerTypes'
|
||||||
|
|
||||||
type InstalledPacksResponse =
|
type InstalledPacksResponse =
|
||||||
ManagerComponents['schemas']['InstalledPacksResponse']
|
ManagerComponents['schemas']['InstalledPacksResponse']
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { createPinia, setActivePinia } from 'pinia'
|
import { createPinia, setActivePinia } from 'pinia'
|
||||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||||
import { ExecutedWsMessage } from '@/schemas/apiSchema'
|
import type { ExecutedWsMessage } from '@/schemas/apiSchema'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
||||||
import * as litegraphUtil from '@/utils/litegraphUtil'
|
import * as litegraphUtil from '@/utils/litegraphUtil'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createPinia, setActivePinia } from 'pinia'
|
import { createPinia, setActivePinia } from 'pinia'
|
||||||
import { beforeEach, describe, expect, it } from 'vitest'
|
import { beforeEach, describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { ServerConfig } from '@/constants/serverConfig'
|
import type { ServerConfig } from '@/constants/serverConfig'
|
||||||
import type { FormItem } from '@/platform/settings/types'
|
import type { FormItem } from '@/platform/settings/types'
|
||||||
import { useServerConfigStore } from '@/stores/serverConfigStore'
|
import { useServerConfigStore } from '@/stores/serverConfigStore'
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
import type { Subgraph } from '@/lib/litegraph/src/litegraph'
|
import type { Subgraph } from '@/lib/litegraph/src/litegraph'
|
||||||
import {
|
import type {
|
||||||
ComfyWorkflow,
|
ComfyWorkflow,
|
||||||
LoadedComfyWorkflow,
|
LoadedComfyWorkflow
|
||||||
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
import {
|
||||||
useWorkflowBookmarkStore,
|
useWorkflowBookmarkStore,
|
||||||
useWorkflowStore
|
useWorkflowStore
|
||||||
} from '@/platform/workflow/management/stores/workflowStore'
|
} from '@/platform/workflow/management/stores/workflowStore'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { ISerialisedGraph } from '@/lib/litegraph/src/types/serialisation'
|
import type { ISerialisedGraph } from '@/lib/litegraph/src/types/serialisation'
|
||||||
import type { IWidget } from '@/lib/litegraph/src/types/widgets'
|
import type { IWidget } from '@/lib/litegraph/src/types/widgets'
|
||||||
import type { InputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
import type { InputSpec } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { TreeNode } from '@/types/treeExplorerTypes'
|
import type { TreeNode } from '@/types/treeExplorerTypes'
|
||||||
import { buildTree, sortedTree } from '@/utils/treeUtil'
|
import { buildTree, sortedTree } from '@/utils/treeUtil'
|
||||||
|
|
||||||
describe('buildTree', () => {
|
describe('buildTree', () => {
|
||||||
|
|||||||
14
tests-ui/tsconfig.json
Normal file
14
tests-ui/tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Test files should not be compiled */
|
||||||
|
"noEmit": true,
|
||||||
|
// "strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"resolveJsonModule": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*.ts",
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user