1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import {
- beforeSetup,
- generateNetworkResult,
- intercept,
- intoMenu,
- successIntercept,
- validateDelete,
- validatePut,
- validateTableList,
- validateTableSearch,
- } from './utils';
- const basicData = {
- id: '1',
- code: '4M',
- name: '4M',
- type: '0',
- };
- describe('枪线管理', function() {
- beforeEach(function() {
- beforeSetup();
- intoMenu('基础资料', '枪线管理');
- });
- beforeEach(function() {
- intercept('/dictionary/getGunLine', function({reply, search}) {
- generateNetworkResult({
- search,
- reply,
- basicData,
- title: 'code',
- skipCondition: val => val === 'type',
- });
- });
- successIntercept(['/dictionary/editGunLine', '/dictionary/delGunLine']);
- });
- it('table', function() {
- validateTableList('gun_table');
- validateTableSearch(
- 'gun_table',
- [
- 'code',
- 'name',
- ],
- {toolId: 'gun_filter', url: '/dictionary/getGunLine'},
- );
- });
- it('operation', function() {
- const {validateAdd, validateEdit} = validatePut(
- 'gun_modal',
- 'gun_table',
- {label: '信息'},
- );
- validateAdd(['name', 'code']);
- validateEdit([{type: 'field', value: basicData.name, id: 'name'}]);
- validateDelete('gun_table', '枪线信息', {title: 'page-1'});
- });
- });
|