// AppBreadcrumb component spec — RFC-WS-PRIMEVUE-PLAN-2-5 AD-2.5-B1. // // Verifies the foundation primitive renders breadcrumb items derived // from APP_NAVIGATION via useNavBreadcrumb. P1 only checks the matched // and unmatched-route paths; integration into AppTopbar is P5 scope. // // Path follows the existing convention (sibling to AppShellV2.spec.ts / // OrganizerLayoutV2.spec.ts under apps/app/tests/component/layouts/). import { describe, expect, it } from 'vitest' import { mount } from '@vue/test-utils' import { defineComponent } from 'vue' import { createMemoryHistory, createRouter } from 'vue-router' import PrimeVue from 'primevue/config' import AppBreadcrumb from '@/components-v2/layout/AppBreadcrumb.vue' const StubRouteComponent = defineComponent({ template: '
' }) function makeRouter(initialRouteName: string | null) { const router = createRouter({ history: createMemoryHistory(), routes: [ { path: '/', name: 'v2-dashboard', component: StubRouteComponent }, { path: '/none', name: 'nonexistent', component: StubRouteComponent }, ], }) if (initialRouteName) router.push({ name: initialRouteName }) return router } describe('AppBreadcrumb (AD-2.5-B1)', () => { it('renders the Dashboard label for the v2-dashboard route', async () => { const router = makeRouter('v2-dashboard') await router.isReady() const wrapper = mount(AppBreadcrumb, { global: { plugins: [router, PrimeVue] }, }) expect(wrapper.text()).toContain('Dashboard') }) it('renders no breadcrumb items when the route is unmatched', async () => { const router = makeRouter('nonexistent') await router.isReady() const wrapper = mount(AppBreadcrumb, { global: { plugins: [router, PrimeVue] }, }) // PrimeVue Breadcrumb renders its items as