Browse Source

test: 增加呆滞品明细测试

xyh 2 years ago
parent
commit
9737569dd9

+ 61 - 0
cypress/e2e/deadProduct.cy.ts

@@ -0,0 +1,61 @@
+import {
+  beforeSetup,
+  exportIntercept,
+  generateNetworkResult,
+  intercept,
+  intoMenu,
+  selectAllFilters,
+  validateExport,
+  validateTableList,
+  validateTableSearch,
+} from './utils';
+
+const basicData = {
+  materialName: '六角螺母\\\\M16;4;彩锌;粗;GB/T41-2000\\\\',
+  amount: '1.00',
+  wllbCode: '3415100010390008',
+  accountSleeve: '8400',
+  storageLocationCode: 'B3-10-4',
+  companyName: '青岛特来电智能充电设备有限公司',
+  ustomerName: '西安特来电智能充电科技有限公司',
+  wbs: '2',
+  scrq: '2022-04-13 10:13:24',
+  id: 8221,
+  storageLocationName: 'B3-10-4',
+  materialId: '00000000000000016029',
+};
+
+describe('呆滞品明细', function () {
+  beforeEach(function () {
+    beforeSetup();
+    intoMenu('库内管理', '呆滞品明细');
+  });
+
+  beforeEach(function () {
+    intercept('/queryList/dullGoods', function ({search, reply}) {
+      generateNetworkResult({search, reply, basicData, title: 'wllbCode'});
+    });
+
+    exportIntercept('/queryList/dullGoodsExport');
+  });
+
+  it('table', function () {
+    selectAllFilters('dead_product_filter', 6);
+    validateTableList('dead_product_table');
+
+    validateTableSearch(
+      'dead_product_table',
+      [
+        'wllbCode',
+        'materialName',
+        'storageLocationName',
+        {id: 'companyCode', type: 'select', value: '8130'},
+        {id: 'ustomerCode', type: 'select', value: 'EC92255'},
+        'wbs',
+      ],
+      {toolId: 'dead_product_filter', url: '/queryList/dullGoods'},
+    );
+
+    validateExport('dead_product_table');
+  });
+});

+ 1 - 0
packages/app/src/pages/dead-product/filter/index.tsx

@@ -38,6 +38,7 @@ const Filter: FC = function () {
         sourceMap={sourceMap}
         fixedMap={fixedMap}
         onFilter={onShowModal}
+        testId='dead_product_filter'
       />
 
       <FilterSelectorModal