Fix Bug #550: AI修复

This commit is contained in:
2026-05-27 04:20:15 +08:00
parent 2a50b29905
commit 4193be1160
2 changed files with 81 additions and 147 deletions

View File

@@ -59,23 +59,30 @@ describe('Bug #550: 门诊医生站-检查申请项目选择交互优化', { tag
cy.login('doctor1', '123456')
cy.visit('/outpatient/examination-application')
// 1. 选择分类并勾选项目
// 1. 选择分类
cy.contains('检查项目分类').should('be.visible')
cy.contains('彩超').click()
cy.contains('128线排').parent().find('input[type="checkbox"]').check()
cy.get('.category-list li').contains('彩超').click()
// 2. 验证已选卡片显示:去除“套餐”前缀,默认收起
cy.get('[data-cy^="selected-card-"]').first().as('selectedCard')
cy.get('@selectedCard').find('.item-title').should('not.contain', '套餐')
cy.get('@selectedCard').find('[data-cy="details-panel"]').should('not.be.visible')
// 2. 勾选项目(模拟数据中存在 128线排彩超套餐
cy.get('.item-list li').contains('128线排彩超套餐').click()
// 3. 验证解耦:展开后检查方法未被自动勾选
cy.get('@selectedCard').find('[data-cy="expand-btn"]').click()
cy.get('@selectedCard').find('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('not.be.checked')
// 3. 验证已选择区域出现卡片,且默认收起
cy.get('[data-cy="selected-card-101"]').should('be.visible')
cy.get('[data-cy="selected-card-101"] .item-title').should('have.text', '128线排彩超') // 验证去除“套餐”
cy.get('[data-cy="details-panel"]').should('not.be.visible') // 验证默认收起
// 4. 验证独立勾选与层级结构
cy.get('@selectedCard').find('[data-cy="method-item"]').first().find('input[type="checkbox"]').check()
cy.get('@selectedCard').find('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('be.checked')
cy.get('@selectedCard').find('.card-header').should('contain.text', '128线排')
// 4. 验证检查方法未自动勾选
cy.get('[data-cy="expand-btn"]').click() // 展开查看
cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('not.be.checked')
// 5. 独立勾选检查方法
cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').click()
cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('be.checked')
// 再次点击取消,验证独立控制
cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').click()
cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('not.be.checked')
// 6. 验证名称完整显示hover 或 title 属性)
cy.get('[data-cy="selected-card-101"] .item-title').should('have.attr', 'title', '128线排彩超')
})
})