Browse Source

test: 增加单据删除日志

xyh 2 years ago
parent
commit
7c6cd18fa9

+ 59 - 0
cypress/e2e/deleteLog.cy.ts

@@ -0,0 +1,59 @@
+import {
+  beforeSetup,
+  exportIntercept,
+  generateNetworkResult,
+  intercept,
+  intoMenu,
+  validateExport,
+  validateTableList,
+  validateTableSearch,
+} from './utils';
+
+const basicData = {
+  id: '21',
+  userId: '3',
+  userName: 'admin',
+  scrq: '2023-04-12 16:39:59',
+  data: '{production_code=DD01, entry_number=1, warehousing_num=0, num=20, wbs=1, material_id=00000000000000012034, id=25, measurement_id=00000000000000000001, type=0, notice_id=TGD01202303230001}',
+  type: '0',
+  documentType: '报工单',
+  startTime: null,
+  endTime: null,
+  page: 0,
+  limit: 0,
+};
+
+describe('单据删除日志', function () {
+  beforeEach(function () {
+    beforeSetup();
+    intoMenu('系统日志', '单据删除日志');
+  });
+
+  beforeEach(function () {
+    intercept('/queryList/getLogData', function ({reply, search}) {
+      generateNetworkResult({search, reply, basicData, title: 'userName'});
+    });
+
+    exportIntercept('/queryList/getLogDataExcel');
+  });
+
+  it('table', function () {
+    validateTableList('order_log_table');
+
+    validateTableSearch(
+      'order_log_table',
+      [
+        'orderLogData',
+        {id: 'orderLogType', value: '质检单', type: 'select'},
+        'userName',
+        {id: 'orderLogDate', type: 'date'},
+      ],
+      {
+        toolId: 'order_log_filter',
+        url: '/queryList/getLogData',
+      },
+    );
+
+    validateExport('order_log_table');
+  });
+});

+ 1 - 2
packages/app/src/pages/order-log/filter/index.tsx

@@ -16,7 +16,6 @@ import {FC} from 'react';
 import {context, searchContext} from '../context';
 
 const options = [
-  {label: '全部', value: ''},
   {label: '质检单', value: '质检单'},
   {label: '生产领料单', value: '生产领料'},
   {label: '非生产领料单', value: '非生产领料'},
@@ -45,7 +44,7 @@ const Filter: FC = function () {
 
   return (
     <Card>
-      <FilterFieldWrapper onSearch={onSearch}>
+      <FilterFieldWrapper onSearch={onSearch} testId='order_log_filter'>
         <FilterField
           name='orderLogData'
           label='单据内容'

+ 1 - 0
packages/app/src/pages/order-log/table/index.tsx

@@ -52,6 +52,7 @@ const TableList: FC = function () {
         columns={columns}
         data={data}
         count={count}
+        data-testid='order_log_table'
       />
     </Card>
   );