feature: Explainable Alerts

This commit is contained in:
voltsrage
2026-06-25 00:25:31 +08:00
parent 279add1e45
commit 666d683d67
61 changed files with 9553 additions and 125 deletions
@@ -29,6 +29,20 @@ describe('AlertCard', () => {
expect(wrapper.text()).toContain('Sepsis Warning (SIRS — Legacy)')
})
it('showsNarrativeSummaryWhenExplanationPresent', () => {
const wrapper = mount(AlertCard, {
props: {
alert: {
...openAlert,
explanation: {
narrativeSummary: 'NEWS2 8 — respiratory rate (+3), SpO2 (+2).',
},
},
},
})
expect(wrapper.text()).toContain('NEWS2 8 — respiratory rate (+3), SpO2 (+2).')
})
it('acknowledgeButtonEmitsEvent', async () => {
const wrapper = mount(AlertCard, { props: { alert: openAlert } })
const ackButton = wrapper.findAll('button').find(b => b.text() === 'Acknowledge')