mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-25 16:59:45 +00:00
[Lint] Sort imports (#2104)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
// @ts-strict-ignore
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
import { ComfyNodeDef, validateComfyNodeDef } from '@/types/apiTypes'
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const EXAMPLE_NODE_DEF: ComfyNodeDef = {
|
||||
input: {
|
||||
@@ -76,7 +77,10 @@ describe('validateNodeDef', () => {
|
||||
it('Should accept all built-in node definitions', async () => {
|
||||
const nodeDefs = Object.values(
|
||||
JSON.parse(
|
||||
fs.readFileSync(path.resolve('./tests-ui/data/object_info.json'))
|
||||
fs.readFileSync(
|
||||
path.resolve('./tests-ui/data/object_info.json'),
|
||||
'utf8'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// @ts-strict-ignore
|
||||
import { validateComfyWorkflow } from '@/types/comfyWorkflow'
|
||||
import { defaultGraph } from '@/scripts/defaultGraph'
|
||||
import fs from 'fs'
|
||||
|
||||
import { defaultGraph } from '@/scripts/defaultGraph'
|
||||
import { validateComfyWorkflow } from '@/types/comfyWorkflow'
|
||||
|
||||
const WORKFLOW_DIR = 'tests-ui/workflows'
|
||||
|
||||
describe('parseComfyWorkflow', () => {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// @ts-strict-ignore
|
||||
import {
|
||||
ComfyInputsSpec,
|
||||
IntInputSpec,
|
||||
StringInputSpec,
|
||||
BooleanInputSpec,
|
||||
ComfyInputsSpec,
|
||||
ComfyNodeDefImpl,
|
||||
FloatInputSpec,
|
||||
ComfyNodeDefImpl
|
||||
} from '@/stores/nodeDefStore' // Adjust the import path as needed
|
||||
IntInputSpec,
|
||||
StringInputSpec
|
||||
} from '@/stores/nodeDefStore'
|
||||
|
||||
// Adjust the import path as needed
|
||||
|
||||
describe('ComfyInputsSpec', () => {
|
||||
it('should transform a plain object to ComfyInputsSpec instance', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getNodeSource, NodeSourceType } from '@/types/nodeSource'
|
||||
import { NodeSourceType, getNodeSource } from '@/types/nodeSource'
|
||||
|
||||
describe('getNodeSource', () => {
|
||||
it('should return UNKNOWN_NODE_SOURCE when python_module is undefined', () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { setActivePinia, createPinia } from 'pinia'
|
||||
import { useKeybindingStore, KeybindingImpl } from '@/stores/keybindingStore'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
|
||||
import { KeybindingImpl, useKeybindingStore } from '@/stores/keybindingStore'
|
||||
|
||||
describe('useKeybindingStore', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { setActivePinia, createPinia } from 'pinia'
|
||||
import { useModelStore } from '@/stores/modelStore'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
|
||||
import { api } from '@/scripts/api'
|
||||
import { useModelStore } from '@/stores/modelStore'
|
||||
|
||||
// Mock the api
|
||||
jest.mock('@/scripts/api', () => ({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { setActivePinia, createPinia } from 'pinia'
|
||||
import { useServerConfigStore } from '@/stores/serverConfigStore'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
|
||||
import { ServerConfig } from '@/constants/serverConfig'
|
||||
import { useServerConfigStore } from '@/stores/serverConfigStore'
|
||||
import type { FormItem } from '@/types/settingTypes'
|
||||
|
||||
const dummyFormItem: FormItem = {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { setActivePinia, createPinia } from 'pinia'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
|
||||
import { api } from '@/scripts/api'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import type { SettingParams } from '@/types/settingTypes'
|
||||
|
||||
// Mock the api
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { setActivePinia, createPinia } from 'pinia'
|
||||
import { UserFile, useUserFileStore } from '@/stores/userFileStore'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
|
||||
import { api } from '@/scripts/api'
|
||||
import { UserFile, useUserFileStore } from '@/stores/userFileStore'
|
||||
|
||||
// Mock the api
|
||||
jest.mock('@/scripts/api', () => ({
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { setActivePinia, createPinia } from 'pinia'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
|
||||
import { api } from '@/scripts/api'
|
||||
import { defaultGraph, defaultGraphJSON } from '@/scripts/defaultGraph'
|
||||
import {
|
||||
LoadedComfyWorkflow,
|
||||
useWorkflowBookmarkStore,
|
||||
useWorkflowStore
|
||||
} from '@/stores/workflowStore'
|
||||
import { api } from '@/scripts/api'
|
||||
import { defaultGraph, defaultGraphJSON } from '@/scripts/defaultGraph'
|
||||
|
||||
// Add mock for api at the top of the file
|
||||
jest.mock('@/scripts/api', () => ({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { buildTree, sortedTree } from '@/utils/treeUtil'
|
||||
import { TreeNode } from 'primevue/treenode'
|
||||
|
||||
import { buildTree, sortedTree } from '@/utils/treeUtil'
|
||||
|
||||
describe('buildTree', () => {
|
||||
it('should handle empty folder items correctly', () => {
|
||||
const items = [
|
||||
|
||||
Reference in New Issue
Block a user