123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import {
- beforeSetup,
- intercept,
- intoMenu,
- generateNetworkResult,
- successIntercept,
- validateTableSearch,
- validateTableList,
- validatePut,
- validateDelete,
- } from './utils';
- const basicData = {
- id: '45',
- equipmentCode: '3907060140030254',
- softwareCode: '3599020010010141',
- equipmentName: '分体式直流充电机;直流240kW;六路输出;偏矩阵;50-1000V;宝马定制版',
- softwareName: '科密EP-9000 一二维码有线USB扫描枪;科密EP-9000 收银农资',
- modifyUser: null,
- modifyTime: null,
- page: 0,
- limit: 0,
- };
- describe('软件类绑定', function() {
- beforeEach(function() {
- beforeSetup();
- intoMenu('基础资料', '软件类绑定');
- });
- beforeEach(function() {
- intercept(
- '/delivery/getEquipmentBindingSoftware',
- function({reply, search}) {
- generateNetworkResult({
- search,
- reply,
- basicData,
- title: 'equipmentCode',
- });
- },
- );
- successIntercept([
- '/delivery/addEquipmentBindingSoftware',
- '/delivery/updateEquipmentBindingSoftware',
- '/delivery/delEquipmentBindingSoftware',
- ]);
- });
- it('table', function() {
- validateTableSearch(
- 'software_bind_table',
- ['equipmentCode', 'softwareCode'],
- {url: '/delivery/getEquipmentBindingSoftware', toolId: 'sofware_filter'},
- );
- validateTableList('software_bind_table');
- });
- it('operation', function() {
- const {validateAdd, validateEdit} = validatePut(
- 'software_modal',
- 'software_bind_table',
- {label: '软件类绑定'},
- );
- validateAdd([
- {type: 'keySelect', id: 'materialCode'},
- {type: 'keySelect', id: 'softwareCode'},
- ]);
- validateEdit([
- {id: 'materialCode', type: 'select', value: 'page-1'},
- {id: 'softwareCode', type: 'select', value: basicData.softwareName},
- ]);
- validateDelete(
- 'software_bind_table',
- '软件类绑定',
- {title: basicData.equipmentName},
- );
- });
- });
|