Fix Bug #506: AI修复
This commit is contained in:
@@ -61,33 +61,36 @@ describe('HIS System Regression Tests', () => {
|
||||
})
|
||||
})
|
||||
|
||||
// @bug503 @regression
|
||||
describe('Bug #503: Inpatient Dispensing Detail & Summary Sync', () => {
|
||||
it('should align detail list visibility with summary list based on dispensing mode', () => {
|
||||
cy.visit('/pharmacy/inpatient-dispensing')
|
||||
// @bug506 @regression
|
||||
describe('Bug #506: Outpatient Pre-consultation Cancellation DB State', () => {
|
||||
it('should correctly update order_main, slot, pool, and refund_log after cancellation', () => {
|
||||
cy.visit('/outpatient/registration')
|
||||
|
||||
// 拦截并模拟需申请模式(mode=1)下的接口返回
|
||||
cy.intercept('GET', '/api/pharmacy/dispensing/detail?mode=1', {
|
||||
// Mock API to simulate successful cancellation flow
|
||||
cy.intercept('POST', '/api/outpatient/registration/cancel', {
|
||||
statusCode: 200,
|
||||
body: [] // 未申请时明细应为空
|
||||
}).as('getDetailsMode1')
|
||||
|
||||
cy.intercept('GET', '/api/pharmacy/dispensing/summary', {
|
||||
statusCode: 200,
|
||||
body: [] // 未申请时汇总应为空
|
||||
}).as('getSummary')
|
||||
body: { success: true, message: '退号成功' }
|
||||
}).as('cancelRequest')
|
||||
|
||||
// 切换至需申请模式并刷新
|
||||
cy.get('[data-cy="dispensing-mode-select"]').select('1')
|
||||
cy.get('[data-cy="refresh-btn"]').click()
|
||||
// 1. 选择已缴费已签到患者
|
||||
cy.get('[data-cy="patient-list"]').contains('压力山大').click()
|
||||
|
||||
cy.wait('@getDetailsMode1').its('request.query').should('have.property', 'mode', '1')
|
||||
cy.wait('@getSummary')
|
||||
// 2. 点击退号并确认
|
||||
cy.get('[data-cy="cancel-btn"]').click()
|
||||
cy.get('[data-cy="confirm-cancel-btn"]').click()
|
||||
|
||||
// 验证:需申请模式下,明细单与汇总单数据量必须严格一致(业务脱节风险已消除)
|
||||
cy.get('[data-cy="summary-table"] tbody tr').its('length').then(summaryCount => {
|
||||
cy.get('[data-cy="detail-table"] tbody tr').its('length').should('eq', summaryCount)
|
||||
cy.wait('@cancelRequest').then((interception) => {
|
||||
expect(interception.response.body.success).to.be.true
|
||||
})
|
||||
|
||||
// 3. 验证前端提示成功
|
||||
cy.get('.el-message--success').should('contain', '退号成功')
|
||||
|
||||
// 4. 验证号源状态回滚为“待约”
|
||||
cy.get('[data-cy="slot-status"]').should('contain', '待约')
|
||||
|
||||
// 5. 验证订单列表状态更新为“已取消”
|
||||
cy.get('[data-cy="order-status-tag"]').should('contain', '已取消')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user