V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
import { createMemoryHistory, createRouter } from 'vue-router'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import KsAppShell from '../KsAppShell.vue'
|
||||
|
||||
function buildTestRouter() {
|
||||
return createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes: [
|
||||
{ path: '/', redirect: '/home' },
|
||||
{ path: '/home', component: { template: '<div>home</div>' }, meta: { screenId: 'SCR-000', module: 'Home', title: '홈' } },
|
||||
{ path: '/research/sell-decision', component: { template: '<div>sell</div>' }, meta: { screenId: 'SCR-002', module: 'Research', section: 'Research', title: '매도 의사결정', order: 1, favoriteAllowed: true } }
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
describe('KsAppShell contract', () => {
|
||||
it('provides skip navigation, header, side navigation, and workspace tab landmarks', async () => {
|
||||
const pinia = createPinia()
|
||||
setActivePinia(pinia)
|
||||
const router = buildTestRouter()
|
||||
router.push('/research/sell-decision')
|
||||
await router.isReady()
|
||||
|
||||
const wrapper = mount(KsAppShell, { global: { plugins: [pinia, router], stubs: { KsDialog: true } }, slots: { default: '<p>화면 내용</p>' } })
|
||||
await wrapper.vm.$nextTick()
|
||||
|
||||
expect(wrapper.get('.ks-skip').attributes('href')).toBe('#ks-main')
|
||||
expect(wrapper.find('header.ks-global-header').exists()).toBe(true)
|
||||
expect(wrapper.get('aside').attributes('aria-label')).toBe('주요 메뉴')
|
||||
expect(wrapper.get('nav.ks-workspace-tabs').attributes('aria-label')).toBe('열린 업무')
|
||||
expect(wrapper.get('main').attributes('tabindex')).toBe('-1')
|
||||
expect(wrapper.text()).toContain('화면 내용')
|
||||
expect(wrapper.text()).toContain('RESEARCH_CANDIDATE_NOT_PRODUCTION')
|
||||
})
|
||||
|
||||
it('opens a workspace tab for the active route and records it as a recent screen', async () => {
|
||||
const pinia = createPinia()
|
||||
setActivePinia(pinia)
|
||||
const router = buildTestRouter()
|
||||
router.push('/research/sell-decision')
|
||||
await router.isReady()
|
||||
|
||||
const wrapper = mount(KsAppShell, { global: { plugins: [pinia, router], stubs: { KsDialog: true } } })
|
||||
await wrapper.vm.$nextTick()
|
||||
|
||||
expect(wrapper.text()).toContain('매도 의사결정')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,30 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { buildNavigationEntries, groupByModule } from '../navigationCatalog'
|
||||
|
||||
describe('navigation catalogue', () => {
|
||||
it('includes the read-only component catalogue in the Design System menu', () => {
|
||||
const entries = buildNavigationEntries([
|
||||
{
|
||||
path: '/internal/ui-standard',
|
||||
meta: {
|
||||
screenId: 'SCR-DEV-001',
|
||||
module: 'Design System',
|
||||
section: 'Design System',
|
||||
title: '컴포넌트 확인',
|
||||
order: 1,
|
||||
favoriteAllowed: false,
|
||||
internalOnly: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/internal/wbs',
|
||||
meta: { screenId: 'SCR-DEV-002', module: 'Internal', title: 'WBS 작업공간', internalOnly: true }
|
||||
}
|
||||
])
|
||||
|
||||
expect(groupByModule(entries).find(section => section.module === 'Design System')?.entries).toEqual([
|
||||
expect.objectContaining({ path: '/internal/ui-standard', title: '컴포넌트 확인', internalOnly: false })
|
||||
])
|
||||
expect(entries.find(entry => entry.path === '/internal/wbs')?.internalOnly).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user