From 8e5b5f15f16998215f322c89c50097943334dc5e Mon Sep 17 00:00:00 2001 From: jon Date: Mon, 19 May 2025 13:12:14 +0200 Subject: [PATCH 1/5] fix: update descriptor when changing client's credit --- src/pages/Customer/Card/CustomerCredits.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/Customer/Card/CustomerCredits.vue b/src/pages/Customer/Card/CustomerCredits.vue index d6e4be89e..1469fbe3d 100644 --- a/src/pages/Customer/Card/CustomerCredits.vue +++ b/src/pages/Customer/Card/CustomerCredits.vue @@ -3,12 +3,13 @@ import { computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import { toCurrency, toDateHourMin } from 'src/filters'; +import { useArrayData } from 'composables/useArrayData'; import VnTable from 'components/VnTable/VnTable.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue'; const { t } = useI18n(); const route = useRoute(); - +const arrayData = useArrayData('Customer'); const filter = computed(() => { return { include: [ @@ -77,7 +78,10 @@ const columns = computed(() => [ :create="{ urlUpdate: `Clients/${route.params.id}`, title: t('New credit'), - onDataSaved: () => tableRef.reload(), + onDataSaved: () => { + arrayData.fetch({ append: false }); + tableRef.reload(); + }, formInitialData: { credit: tableData.at(0)?.amount }, }" > From 547d0a289549260c74d65a77cc7e89fba1b03f40 Mon Sep 17 00:00:00 2001 From: jon Date: Mon, 19 May 2025 13:22:24 +0200 Subject: [PATCH 2/5] feat: improved test --- .../integration/customer/clientCredits.spec.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/cypress/integration/customer/clientCredits.spec.js b/test/cypress/integration/customer/clientCredits.spec.js index f39f3c06c..2d7c660f2 100644 --- a/test/cypress/integration/customer/clientCredits.spec.js +++ b/test/cypress/integration/customer/clientCredits.spec.js @@ -1,5 +1,8 @@ /// describe('Client credits', () => { + const credit = 100; + const descriptorCreditValue = '[data-cy="vnLvCredit"] > .value > span'; + beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); @@ -11,9 +14,19 @@ describe('Client credits', () => { it('Should put a new credit', () => { cy.get('.q-page').should('be.visible'); cy.dataCy('vnTableCreateBtn').click(); - cy.dataCy('Credit_input').type('100'); + cy.dataCy('Credit_input').type(credit); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data saved'); + cy.get(descriptorCreditValue) + .invoke('text') + .then((text) => { + const creditValue = parseInt( + text.trim().replace('€', '').split('.')[0], + 10, + ); + cy.log(creditValue); + expect(creditValue).to.equal(credit); + }); }); it('Should put a new credit with value 0 to close the client card', () => { From e6a73d7b421f6cdf6082309a7483308303637ab2 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 20 May 2025 08:49:49 +0200 Subject: [PATCH 3/5] test: skip ticketLackDetails --- .../integration/ticket/negative/TicketLackDetail.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js index 4d1b0251d..3e2f226c6 100644 --- a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js +++ b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js @@ -13,7 +13,7 @@ const clickNotificationAction = () => { expect(firstArg).to.include(`/ticket/${ticketId}/sale`); }); }; -describe('Ticket Lack detail', { testIsolation: true }, () => { +describe.skip('Ticket Lack detail', { testIsolation: true }, () => { beforeEach(() => { cy.viewport(1980, 1020); cy.login('developer'); From 361183357bdf32befe5c71c0239dadcbf068e3e4 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 20 May 2025 09:10:38 +0200 Subject: [PATCH 4/5] fix: update order in SupplierConsumption data fetching --- src/pages/Supplier/Card/SupplierConsumption.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Supplier/Card/SupplierConsumption.vue b/src/pages/Supplier/Card/SupplierConsumption.vue index 26fa50c51..0b0007dd8 100644 --- a/src/pages/Supplier/Card/SupplierConsumption.vue +++ b/src/pages/Supplier/Card/SupplierConsumption.vue @@ -26,7 +26,8 @@ const { notify } = useNotify(); const totalRows = ref({}); const arrayData = useArrayData('SupplierConsumption', { url: 'Suppliers/consumption', - order: ['itemTypeFk', 'itemName', 'itemSize'], + order: ['shipped', 'itemTypeFk', 'itemName', 'itemSize'], + limit: 0, userFilter: { where: { supplierFk: route.params.id } }, }); const headerColumns = computed(() => [ From 807db2575034e487378e90e74e60a64d4804de7e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 20 May 2025 09:12:30 +0200 Subject: [PATCH 5/5] fix: update order in SupplierConsumption data fetching --- src/pages/Supplier/Card/SupplierConsumption.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Supplier/Card/SupplierConsumption.vue b/src/pages/Supplier/Card/SupplierConsumption.vue index 0b0007dd8..db1348193 100644 --- a/src/pages/Supplier/Card/SupplierConsumption.vue +++ b/src/pages/Supplier/Card/SupplierConsumption.vue @@ -26,7 +26,7 @@ const { notify } = useNotify(); const totalRows = ref({}); const arrayData = useArrayData('SupplierConsumption', { url: 'Suppliers/consumption', - order: ['shipped', 'itemTypeFk', 'itemName', 'itemSize'], + order: ['shipped DESC', 'itemTypeFk', 'itemName', 'itemSize'], limit: 0, userFilter: { where: { supplierFk: route.params.id } }, });