feature: Improve dashboard functionality

This commit is contained in:
voltsrage
2026-06-23 20:19:32 +08:00
parent dd0fd88731
commit 79b6d9d85e
60 changed files with 2857 additions and 164 deletions
@@ -0,0 +1,49 @@
import { describe, it, expect, vi } from 'vitest'
import { mount } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
import SepsisBoardView from '@/views/SepsisBoardView.vue'
const { mockPush } = vi.hoisted(() => ({
mockPush: vi.fn(),
}))
vi.mock('vue-router', () => ({
useRouter: () => ({ push: mockPush }),
}))
vi.mock('@/composables/usePolling', () => ({
usePolling: () => {},
}))
const bundles = [
{
id: 'b1',
encounterId: 'enc-1',
firstName: 'Alice',
lastName: 'A',
mrn: 'M1',
department: 'Icu',
roomBed: '101',
recognizedAt: '2026-06-23T12:00:00Z',
deadlineAt: '2026-06-23T15:00:00Z',
complianceStatus: 'IN_PROGRESS',
elements: [
{ id: 'e1', elementType: 'BloodCultures', status: 'Completed' },
{ id: 'e2', elementType: 'SerumLactate', status: 'Pending' },
],
},
]
vi.mock('@/api/sepsis', () => ({
fetchSepsisBundles: vi.fn(() => Promise.resolve({ items: bundles, totalCount: 1 })),
}))
describe('SepsisBoardView', () => {
it('rendersBundleBoardWithSummary', async () => {
setActivePinia(createPinia())
const wrapper = mount(SepsisBoardView)
await vi.waitFor(() => expect(wrapper.text()).toContain('Alice A'))
expect(wrapper.text()).toContain('Sepsis Bundle Board')
expect(wrapper.text()).toContain('Serum lactate')
})
})