diff --git a/src/app/layouts/AppLayout.test.ts b/src/app/layouts/AppLayout.test.ts index c740c98e..af7cfc20 100644 --- a/src/app/layouts/AppLayout.test.ts +++ b/src/app/layouts/AppLayout.test.ts @@ -7,9 +7,6 @@ import { ElMessageBox } from 'element-plus' import { useAuthStore } from '@/core/auth/auth' import AppLayout from './AppLayout.vue' -const { getUnreadCount } = vi.hoisted(() => ({ getUnreadCount: vi.fn() })) -vi.mock('@/modules/notifications/api/notificationCenter', () => ({ getUnreadCount })) - const CachedPage = defineComponent({ setup() { const count = ref(0) @@ -29,14 +26,13 @@ async function mountLayout(path = '/') { const auth = useAuthStore() auth.token = 'token' auth.user = { id: '1', name: '平台管理员', account: 'admin', roles: ['PLATFORM_ADMIN'] } - auth.permissions = ['platform:warehouse:list', 'platform:notification:view'] + auth.permissions = ['platform:warehouse:list', 'platform:notification:task:list', 'platform:notification:template:list'] const router = createRouter({ history: createMemoryHistory(), routes: [ { path: '/', name: 'home', component: { template: '

page

' }, meta: { requiresAuth: true, workspaceTab: false, keepAlive: false } }, { path: '/customers', name: 'customers', component: CachedPage, meta: { title: '客户管理', showPageHeading: false, requiresAuth: true } }, { path: '/warehouses', name: 'warehouses', component: { template: '

warehouses

' }, meta: { title: '仓库管理', requiresAuth: true } }, - { path: '/notifications/mine', name: 'my-notifications', component: { template: '

messages

' }, meta: { title: '我的消息', requiresAuth: true } }, { path: '/login', component: { template: '

login

' } }, ], }) @@ -49,15 +45,16 @@ async function mountLayout(path = '/') { } describe('AppLayout', () => { - beforeEach(() => { vi.mocked(ElMessageBox.confirm).mockReset(); getUnreadCount.mockReset().mockResolvedValue(4) }) + beforeEach(() => { vi.mocked(ElMessageBox.confirm).mockReset() }) it('shows the authenticated identity without a role preview switcher', async () => { const { wrapper } = await mountLayout() expect(wrapper.text()).toContain('登录身份:平台管理员(admin)') expect(wrapper.text()).not.toContain('权限预览') - await flushPromises() - expect(wrapper.get('[aria-label="消息中心,4 条未读"]').attributes('disabled')).toBeUndefined() - expect(wrapper.get('.notification-count').text()).toBe('4') + expect(wrapper.get('[aria-label="消息中心"]').attributes('disabled')).toBeUndefined() + expect(wrapper.text()).toContain('消息管理') + expect(wrapper.text()).toContain('模板管理') + expect(wrapper.text()).not.toContain('我的消息') }) it('hides the shell heading when the route opts out', async () => { diff --git a/src/app/layouts/AppLayout.vue b/src/app/layouts/AppLayout.vue index 52834104..3b65b1ee 100644 --- a/src/app/layouts/AppLayout.vue +++ b/src/app/layouts/AppLayout.vue @@ -1,5 +1,5 @@ diff --git a/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts b/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts index 77f10b0f..b33a3906 100644 --- a/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts +++ b/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts @@ -24,9 +24,9 @@ describe('InboundWorkflowWorkspace', () => { it('opens measurement editing and review in prototype-sized centered dialogs', () => { expect(source).toContain('title="编辑入库测量数据"') - expect(source).toContain('width="min(1900px, calc(100vw - 32px))"') + expect(source).toContain('width="min(1240px, calc(100vw - 32px))"') expect(source).toContain('title="审核入库测量数据"') - expect(source).toContain('width="min(1700px, calc(100vw - 32px))"') + expect(source).toContain('width="min(1240px, calc(100vw - 32px))"') expect(source).toContain('height: 92vh') expect(source).toContain('max-height: 92vh') expect(source).toContain('.el-dialog__body) { min-height: 0; flex: 1 1 auto; overflow-y: auto;') diff --git a/src/modules/inbounds/components/InboundWorkflowWorkspace.vue b/src/modules/inbounds/components/InboundWorkflowWorkspace.vue index c01eb4e4..cb6c61ab 100644 --- a/src/modules/inbounds/components/InboundWorkflowWorkspace.vue +++ b/src/modules/inbounds/components/InboundWorkflowWorkspace.vue @@ -1,6 +1,6 @@