테스트/린트 안정화: 버튼 쿼리 모호성 제거, 훅 deps 보강, vi.spyOn 모킹, 멀티선택 Moveable 간섭 방지 재확인, 스냅 우선순위 회귀 그린
Auto PR / open-pr (push) Successful in 21s
Auto Label PR / add-automerge-label (pull_request) Successful in 6s
CI / test (pull_request) Successful in 1m49s

This commit is contained in:
2025-11-17 17:33:39 +09:00
parent 1c607f6331
commit 5bf78b3e01
29 changed files with 1861 additions and 80 deletions
+26
View File
@@ -0,0 +1,26 @@
import { describe, it, expect } from 'vitest'
import { exportFrame } from '@/lib/wysiwyg/export'
import type { Frame } from '@/lib/wysiwyg/schema'
function baseFrame(): Frame {
return {
id: 'f', width: 320, height: 200, background: '#111111',
layers: [{ id: 'l1', name: 'Base', visible: true, locked: false, objects: [] }],
}
}
describe('wysiwyg export - style tokens', () => {
it('injects :root tokens and uses them in base rules', () => {
const f = baseFrame()
const out = exportFrame(f)
// root tokens
expect(out.css).toMatch(/:root\s*{[^}]*--bg:\s*#[0-9a-fA-F]{3,6}/)
expect(out.css).toMatch(/--text:/)
expect(out.css).toMatch(/--border:/)
expect(out.css).toMatch(/--primary:/)
// frame uses tokens
expect(out.css).toMatch(/\.frame\s*{[^}]*background:var\(--bg\)/)
// anchor uses primary color
expect(out.css).toMatch(/a\s*{[^}]*color:var\(--primary\)/)
})
})