import { ref } from 'vue'; import { useLayout2x2 } from '@/components/modal/layouts/composables/useLayout2x2'; import { AnchorPoint } from '@3cr/types-ts'; describe('useLayout2x2 tests', () => { const canvas = document.createElement('canvas'); canvas.getBoundingClientRect = vi.fn( () => ({ x: 0, y: 0, width: 100, height: 100 }) as DOMRect, ); it('useLayout2x2 volume', () => { const anchor = AnchorPoint.TOP_LEFT; const { layout } = useLayout2x2(anchor, canvas, ref(16)); expect(layout.value).toEqual({ height: 26, width: 26, x: 16, y: 16 }); }); });