70 lines
2.7 KiB
TypeScript
Executable File
70 lines
2.7 KiB
TypeScript
Executable File
import { describe, it, expect } from 'vitest'
|
|
import { mount } from '@vue/test-utils'
|
|
import QueueManagement from '@/views/outpatient/triage/QueueManagement.vue'
|
|
import ExamApply from '@/views/outpatient/doctor/ExamApply.vue'
|
|
|
|
describe('HIS System Regression Tests', () => {
|
|
it('should render basic triage queue layout', () => {
|
|
const wrapper = mount(QueueManagement)
|
|
expect(wrapper.find('.triage-queue-container').exists()).toBe(true)
|
|
})
|
|
})
|
|
|
|
/**
|
|
* @bug550 @regression
|
|
* 验证检查申请项目选择交互:解耦勾选、名称完整显示、明细默认收起且层级分明
|
|
*/
|
|
describe('Bug #550 Regression: 检查申请项目选择交互优化', () => {
|
|
it('should decouple item and method selection, hide package prefix, and collapse details by default', async () => {
|
|
const wrapper = mount(ExamApply, {
|
|
global: {
|
|
stubs: ['el-checkbox', 'el-collapse-transition', 'el-icon', 'el-button', 'el-tooltip']
|
|
}
|
|
})
|
|
const vm = wrapper.vm as any
|
|
|
|
// 1. 验证解耦逻辑:项目勾选与方法勾选为独立函数,互不干扰
|
|
expect(typeof vm.onItemSelect).toBe('function')
|
|
expect(typeof vm.onMethodChange).toBe('function')
|
|
|
|
// 2. 验证名称清理:去除“套餐”冗余前缀/后缀
|
|
expect(vm.cleanName('128线排套餐')).toBe('128线排')
|
|
expect(vm.cleanName('常规彩超')).toBe('常规彩超')
|
|
expect(vm.cleanName('项目套餐明细')).toBe('')
|
|
})
|
|
})
|
|
|
|
/**
|
|
* @bug544 @regression
|
|
* 验证智能分诊队列列表可显示“完诊”状态患者,且支持按时间范围查询历史队列(默认当天)
|
|
*/
|
|
describe('Bug #544 Regression: 智能分诊队列状态过滤与历史查询', () => {
|
|
it('should include COMPLETED status in filter and default date to today', async () => {
|
|
const wrapper = mount(QueueManagement, {
|
|
global: {
|
|
stubs: ['el-table', 'el-pagination', 'el-card', 'el-date-picker', 'el-select']
|
|
}
|
|
})
|
|
const vm = wrapper.vm as any
|
|
|
|
// 验证默认日期为当天
|
|
const today = new Date().toISOString().split('T')[0]
|
|
expect(vm.queryParams.dateRange).toBeDefined()
|
|
expect(vm.queryParams.dateRange[0]).toBe(today)
|
|
expect(vm.queryParams.dateRange[1]).toBe(today)
|
|
|
|
// 验证状态选项包含 COMPLETED
|
|
const statusOptions = vm.statusOptions || []
|
|
const completedOption = statusOptions.find((opt: any) => opt.value === 'COMPLETED')
|
|
expect(completedOption).toBeDefined()
|
|
expect(completedOption.label).toBe('完诊')
|
|
|
|
// 验证状态标签映射正确
|
|
expect(vm.getStatusLabel('COMPLETED')).toBe('完诊')
|
|
expect(vm.getStatusType('COMPLETED')).toBe('success')
|
|
|
|
// 验证查询方法存在
|
|
expect(typeof vm.handleQuery).toBe('function')
|
|
})
|
|
})
|