34 lines
1.6 KiB
TypeScript
Executable File
34 lines
1.6 KiB
TypeScript
Executable File
import { describe, it, expect } from 'vitest';
|
||
import { mount } from '@vue/test-utils';
|
||
// 假设项目使用 Cypress 或 Vitest,此处以标准 E2E 断言结构编写
|
||
// @bug550 @regression
|
||
describe('Bug #550 Regression: 检查申请项目选择交互优化', () => {
|
||
it('应解耦项目与检查方法勾选,卡片宽度自适应且默认收起明细', () => {
|
||
// 1. 模拟进入门诊医生站检查申请页
|
||
cy.visit('/outpatient/doctor/examination');
|
||
|
||
// 2. 展开彩超分类并勾选项目
|
||
cy.get('.category-tree').contains('彩超').click();
|
||
cy.get('.item-list').contains('128线排套餐').click();
|
||
|
||
// 验证:检查方法未被自动勾选(解耦)
|
||
cy.get('.method-checkbox-group input').should('not.be.checked');
|
||
|
||
// 3. 验证已选卡片显示
|
||
cy.get('.selected-card').should('exist');
|
||
cy.get('.selected-card .item-name').should('contain', '128线排').and('not.contain', '套餐');
|
||
// 验证宽度自适应(非固定宽度导致截断)
|
||
cy.get('.selected-card').should('have.css', 'width').and('match', /auto|100%/);
|
||
|
||
// 4. 验证明细默认收起,且无冗余标签
|
||
cy.get('.selected-card .details-section').should('not.be.visible');
|
||
cy.get('.selected-card').should('not.contain', '项目套餐明细');
|
||
|
||
// 5. 验证点击可展开/收起,且层级为 项目 > 检查方法
|
||
cy.get('.selected-card .card-header').click();
|
||
cy.get('.selected-card .details-section').should('be.visible');
|
||
cy.get('.selected-card .details-section .method-item').should('exist');
|
||
cy.get('.selected-card .details-section').should('contain', '检查方法');
|
||
});
|
||
});
|