import { beforeSetup, generateNetworkResult, intercept, intoMenu, successIntercept, tableBtnClick, validateDialog, validateMessageContent, validatePut, validateTableList, validateTableSearch, } from './utils'; const basicData = { id: '1', station: 'ZK-15', type: '1', modifyUser: 'yunwei', modifyTime: '2023-06-08 14:49:37', page: 0, limit: 0, editType: null, }; const options = [ { id: '1', station: 'ZK-16及内侧线体共用', type: null, modifyUser: null, modifyTime: null, page: 0, limit: 0, editType: null, }, { id: '2', station: 'ZK-15', type: null, modifyUser: null, modifyTime: null, page: 0, limit: 0, editType: null, }, ]; describe('agv', function() { beforeEach(function() { beforeSetup(); intoMenu('出库管理', 'AGV管理'); }); beforeEach(function() { successIntercept(['/agv/editAgv']); intercept('/agv/getAgvStation', function({reply, search}) { generateNetworkResult({search, reply, basicData, title: 'station'}); }); intercept('/agv/getAgvPoint', function({reply}) { reply({ body: { msg: '200', data: options, }, }); }); }); it('table', function() { validateTableList('agv_table'); validateTableSearch( 'agv_table', [ {type: 'select', id: 'type', value: '0'}, {type: 'select', id: 'station', value: 'ZK-16及内侧线体共用'}, ], {toolId: 'agv_filter', url: '/agv/getAgvStation'}, ); }); it('options', function() { const {validateAdd} = validatePut( 'agv_modal', 'agv_table', { label: '调度任务', }, ); validateAdd([{id: 'station', type: 'select'}]); tableBtnClick('agv_table', 0); validateDialog('确认收货', '你确定此任务已收货吗?', {confirm: true}); validateMessageContent('已确认收货'); }); });