mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 01:20:09 +00:00
Replace @trivago/prettier-plugin-sort-imports with @prettier/plugin-oxc and @ianvs/prettier-plugin-sort-imports for improved performance. Changes: - Add @prettier/plugin-oxc (Rust-based fast parser) - Add @ianvs/prettier-plugin-sort-imports (import sorting compatible with oxc) - Remove @trivago/prettier-plugin-sort-imports - Update .prettierrc to use new plugins and compatible import order config - Reformat all files with new plugin configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
969 B
TypeScript
34 lines
969 B
TypeScript
import { describe } from 'vitest'
|
|
|
|
import {
|
|
LGraph,
|
|
LGraphGroup,
|
|
LGraphNode,
|
|
type ISerialisedGraph
|
|
} from '@/lib/litegraph/src/litegraph'
|
|
|
|
import { test } from './fixtures/testExtensions'
|
|
|
|
describe('LGraph Serialisation', () => {
|
|
test('can (de)serialise node / group titles', ({ expect, minimalGraph }) => {
|
|
const nodeTitle = 'Test Node'
|
|
const groupTitle = 'Test Group'
|
|
|
|
minimalGraph.add(new LGraphNode(nodeTitle))
|
|
minimalGraph.add(new LGraphGroup(groupTitle))
|
|
|
|
expect(minimalGraph.nodes.length).toBe(1)
|
|
expect(minimalGraph.nodes[0].title).toEqual(nodeTitle)
|
|
|
|
expect(minimalGraph.groups.length).toBe(1)
|
|
expect(minimalGraph.groups[0].title).toEqual(groupTitle)
|
|
|
|
const serialised = JSON.stringify(minimalGraph.serialize())
|
|
const deserialised = JSON.parse(serialised) as ISerialisedGraph
|
|
|
|
const copied = new LGraph(deserialised)
|
|
expect(copied.nodes.length).toBe(1)
|
|
expect(copied.groups.length).toBe(1)
|
|
})
|
|
})
|