Skip to content

Commit 6f17802

Browse files
committed
test: Fix useTransformState since it's now a singleton composable.
1 parent b86640d commit 6f17802

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests-ui/tests/composables/element/useTransformState.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { beforeEach, describe, expect, it } from 'vitest'
22

33
import { useTransformState } from '@/renderer/core/layout/transform/useTransformState'
4+
import type { LGraphCanvas } from '@/lib/litegraph/src/LGraphCanvas'
45

56
// Create a mock canvas context for transform testing
67
function createMockCanvasContext() {
@@ -27,10 +28,12 @@ function createMockCanvasContext() {
2728
}
2829

2930
describe('useTransformState', () => {
30-
let transformState: ReturnType<typeof useTransformState>
31+
const transformState = useTransformState()
3132

3233
beforeEach(() => {
33-
transformState = useTransformState()
34+
transformState.syncWithCanvas({
35+
ds: { offset: [0, 0] }
36+
} as unknown as LGraphCanvas)
3437
})
3538

3639
describe('initial state', () => {

0 commit comments

Comments
 (0)