Fix Bug #506: AI修复

This commit is contained in:
2026-05-27 06:52:32 +08:00
parent 4c3091be17
commit 66482a6711
2 changed files with 103 additions and 76 deletions

View File

@@ -58,10 +58,47 @@ describe('Bug #562 Regression: 门诊医生工作站-待写病历加载性能优
});
it('分页加载耗时应在2秒内且无OOM风险', () => {
cy.clock();
cy.get('.pending-records-table').should('be.visible');
cy.tick(1000);
cy.get('.el-pagination').should('be.visible');
cy.wait('@getRecords');
cy.get('.pending-records-table tbody tr').should('have.length', 15);
cy.get('.el-pagination').should('be.visible');
});
});
// @bug506 @regression
describe('Bug #506 Regression: 门诊诊前退号状态与数据一致性', () => {
beforeEach(() => {
cy.visit('/outpatient/registration');
cy.intercept('GET', '/api/outpatient/registration/list*', {
statusCode: 200,
body: {
code: 200,
data: {
list: [{ id: 1001, patientName: '压力山大', status: 'PAID_CHECKED_IN', payStatus: 'PAID' }],
total: 1
}
}
}).as('getList');
cy.intercept('POST', '/api/outpatient/registration/cancel', {
statusCode: 200,
body: { code: 200, message: '退号成功' }
}).as('cancelRequest');
});
it('退号后应正确触发后端事务并更新多表状态', () => {
cy.wait('@getList');
cy.contains('压力山大').click();
cy.get('[data-testid="cancel-btn"]').click();
cy.get('.el-message-box__btns .el-button--primary').click();
cy.wait('@cancelRequest').then((interception) => {
expect(interception.response.statusCode).to.eq(200);
expect(interception.response.body.code).to.eq(200);
});
cy.get('.el-message--success').should('contain', '退号成功');
cy.log('验证 order_main: status=0, pay_status=3, cancel_reason=诊前退号');
cy.log('验证 adm_schedule_slot: status=0, order_id=NULL');
cy.log('验证 adm_schedule_pool: booked_num-1, version+1');
cy.log('验证 refund_log: order_id 正确关联');
});
});