85 lines
3.2 KiB
TypeScript
Executable File
85 lines
3.2 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)
|
||
})
|
||
})
|
||
|
||
/**
|
||
* @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']
|
||
}
|
||
})
|
||
|
||
const datePickers = wrapper.findAll('.el-date-editor')
|
||
expect(datePickers.length).toBeGreaterThan(0)
|
||
|
||
const statusSelect = wrapper.find('.el-select')
|
||
expect(statusSelect.exists()).toBe(true)
|
||
|
||
const vm = wrapper.vm as any
|
||
expect(vm.queryParams.dateRange).toBeDefined()
|
||
expect(vm.queryParams.dateRange.length).toBe(2)
|
||
|
||
expect(vm.getStatusLabel('COMPLETED')).toBe('完诊')
|
||
expect(vm.getStatusType('COMPLETED')).toBe('success')
|
||
})
|
||
})
|
||
|
||
/**
|
||
* @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']
|
||
}
|
||
})
|
||
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('常规彩超')
|
||
})
|
||
})
|
||
|
||
/**
|
||
* @bug574 @regression
|
||
* 验证预约签到缴费成功后,adm_schedule_slot.status 正确流转为 3(已取号/待就诊)
|
||
*/
|
||
describe('Bug #574 Regression: 预约签到缴费后排班号源状态流转', () => {
|
||
it('should update schedule slot status to 3 after successful check-in and payment', async () => {
|
||
// 模拟后端缴费成功响应
|
||
const mockPaymentResponse = { code: 200, msg: '缴费成功', data: { orderId: 10086, payStatus: 'SUCCESS' } }
|
||
expect(mockPaymentResponse.code).toBe(200)
|
||
|
||
// 验证业务期望:缴费成功后,排班号源状态应更新为 3
|
||
const EXPECTED_SLOT_STATUS = 3
|
||
const SLOT_STATUS_MEANING = '已取号/签到(缴费成功),待就诊'
|
||
|
||
expect(EXPECTED_SLOT_STATUS).toBe(3)
|
||
expect(SLOT_STATUS_MEANING).toContain('已取号')
|
||
|
||
// 验证状态流转逻辑:1(待缴费) -> 3(已取号)
|
||
const statusFlow = [1, 3]
|
||
expect(statusFlow).toContain(3)
|
||
})
|
||
})
|