test: lock shared layout contracts (V13-FE-006)

This commit is contained in:
2026-08-09 01:04:04 +09:00
parent e5da826329
commit a3c20240ab
3 changed files with 55 additions and 0 deletions
@@ -0,0 +1,25 @@
import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
import AppShellLayout from '../AppShellLayout.vue'
import PageLayout from '../PageLayout.vue'
describe('shared layout contracts', () => {
it('provides skip navigation, structural landmarks, and the automation boundary by default', () => {
const wrapper = mount(AppShellLayout, { slots: { navigation: '<a href="/ops">운영</a>', default: '<p>화면 내용</p>' } })
expect(wrapper.get('.ks-skip').attributes('href')).toBe('#ks-main')
expect(wrapper.get('aside').attributes('aria-label')).toBe('주요 메뉴')
expect(wrapper.get('main').attributes('tabindex')).toBe('-1')
expect(wrapper.get('[role="status"]').text()).toContain('자동주문/KIS 제출 OFF')
})
it('keeps page evidence and optional content regions structurally separate', () => {
const wrapper = mount(PageLayout, {
props: { title: '데이터 수집', status: 'READONLY', asOf: '2026-08-09T00:00:00Z', version: 'v4' },
slots: { filters: '<form>조건</form>', default: '<article>본문</article>', aside: '<section>증거</section>', footer: '<button>닫기</button>' }
})
expect(wrapper.get('h1').text()).toBe('데이터 수집')
expect(wrapper.text()).toContain('As-of: 2026-08-09T00:00:00Z')
expect(wrapper.get('.ks-page__workspace').classes()).toContain('has-aside')
expect(wrapper.get('.ks-page__footer').get('button').text()).toBe('닫기')
})
})