From a9241b17f570966055aae3634b94978c2f2dd1d9 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 6 Nov 2023 16:03:36 +0100 Subject: [PATCH] ref #5835 tests basicData and list --- .../InvoiceIn/Card/InvoiceInBasicData.vue | 549 +++++++++--------- .../integration/invoiceInBasicData.spec.js | 24 + .../cypress/integration/invoiceInList.spec.js | 1 + .../InvoiceIn/InvoiceInBasicData.spec.js | 46 ++ 4 files changed, 337 insertions(+), 283 deletions(-) create mode 100644 test/cypress/integration/invoiceInBasicData.spec.js create mode 100644 test/vitest/__tests__/pages/InvoiceIn/InvoiceInBasicData.spec.js diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index 3edfab0d6..3419492b7 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -85,10 +85,10 @@ async function setCreateDms() { async function edit() { try { - if (!dms.value.companyId) throw new Error(t(`The company can't be empty`)); - if (!dms.value.warehouseId) throw new Error(t(`The warehouse can't be empty`)); - if (!dms.value.dmsTypeId) throw new Error(t(`The DMS Type can't be empty`)); - if (!dms.value.description) throw new Error(t(`The description can't be empty`)); + if (!dms.value.companyId) throw Error(t(`The company can't be empty`)); + if (!dms.value.warehouseId) throw Error(t(`The warehouse can't be empty`)); + if (!dms.value.dmsTypeId) throw Error(t(`The DMS Type can't be empty`)); + if (!dms.value.description) throw Error(t(`The description can't be empty`)); const formData = new FormData(); @@ -111,7 +111,7 @@ async function edit() { }); } catch (error) { quasar.notify({ - message: t(`${error}`), + message: t(`${error.message}`), type: 'negative', }); } @@ -119,11 +119,11 @@ async function edit() { async function create() { try { - if (!dms.value.companyId) throw new Error(t(`The company can't be empty`)); - if (!dms.value.warehouseId) throw new Error(t(`The warehouse can't be empty`)); - if (!dms.value.dmsTypeId) throw new Error(t(`The DMS Type can't be empty`)); - if (!dms.value.description) throw new Error(t(`The description can't be empty`)); - if (!dms.value.files) throw new Error(t(`The files can't be empty`)); + if (!dms.value.companyId) throw Error(t(`The company can't be empty`)); + if (!dms.value.warehouseId) throw Error(t(`The warehouse can't be empty`)); + if (!dms.value.dmsTypeId) throw Error(t(`The DMS Type can't be empty`)); + if (!dms.value.description) throw Error(t(`The description can't be empty`)); + if (!dms.value.files) throw Error(t(`The files can't be empty`)); const formData = new FormData(); @@ -144,8 +144,9 @@ async function create() { type: 'positive', }); } catch (error) { + console.log(error); quasar.notify({ - message: t(`${error}`), + message: t(`${error.message}`), type: 'negative', }); } @@ -197,274 +198,257 @@ async function create() { @on-fetch="(data) => (userConfig = data)" auto-load /> -
- - -