simplify unit tests

This commit is contained in:
bymyself
2025-09-04 18:24:48 -07:00
parent 2f512b847d
commit 4fc89847ab
3 changed files with 73 additions and 56 deletions

View File

@@ -2,7 +2,29 @@ import { beforeEach, describe, expect, it } from 'vitest'
import { useTransformState } from '@/composables/element/useTransformState'
import { createMockCanvasContext } from '../../helpers/nodeTestHelpers'
// Create a mock canvas context for transform testing
function createMockCanvasContext() {
return {
canvas: {
width: 1280,
height: 720,
getBoundingClientRect: () => ({
left: 0,
top: 0,
width: 1280,
height: 720,
right: 1280,
bottom: 720,
x: 0,
y: 0
})
},
ds: {
offset: [0, 0],
scale: 1
}
}
}
describe('useTransformState', () => {
let transformState: ReturnType<typeof useTransformState>