From 5dc14b8dc1e715f8442fe077342528b3da71cc7b Mon Sep 17 00:00:00 2001 From: provira Date: Wed, 8 Jan 2025 13:02:08 +0100 Subject: [PATCH 1/6] feat: refs #7055 created FilterItemForm test --- .../__tests__/FilterItemForm.spec.js | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/components/__tests__/FilterItemForm.spec.js diff --git a/src/components/__tests__/FilterItemForm.spec.js b/src/components/__tests__/FilterItemForm.spec.js new file mode 100644 index 000000000..f36a479d9 --- /dev/null +++ b/src/components/__tests__/FilterItemForm.spec.js @@ -0,0 +1,71 @@ +import { createWrapper, axios } from 'app/test/vitest/helper'; +import FilterItemForm from 'components/FilterItemForm.vue'; +import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest'; + +describe('FilterItemForm', () => { + let vm; + let wrapper; + + beforeAll(() => { + wrapper = createWrapper(FilterItemForm, { + props: { + url: 'Items/withName', + }, + }); + vm = wrapper.vm; + wrapper = wrapper.wrapper; + + vi.spyOn(axios, 'get').mockResolvedValue({ data: [] }); + }); + + it('should set up itemFilter and itemFilterParams correctly', async () => { + wrapper.setProps({ + itemFilter: { + include: [ + { relation: 'producer', scope: { fields: ['name'] } }, + { relation: 'ink', scope: { fields: ['name'] } }, + ], + where: { name: { like: '%bolas de madera%' } }, + }, + itemFilterParams: { name: 'bolas de madera' }, + }); + + await vm.onSubmit(); + + const expectedFilter = { + include: [ + { relation: 'producer', scope: { fields: ['name'] } }, + { relation: 'ink', scope: { fields: ['name'] } }, + ], + where: { + name: { like: '%bolas de madera%' }, + size: 'large', + producerFk: 1, + typeFk: 2, + inkFk: 3, + }, + }; + + expect(axios.get).toHaveBeenCalledWith('Items/withName', { + params: { filter: JSON.stringify(expectedFilter) }, + }); + }); + + it('should handle an empty itemFilterParams correctly', async () => { + vm.itemFilterParams = {}; + + await vm.onSubmit(); + + const expectedFilter = { + include: [ + { relation: 'producer', scope: { fields: ['name'] } }, + { relation: 'ink', scope: { fields: ['name'] } }, + ], + where: {}, + }; + + expect(axios.get).toHaveBeenCalledWith('Items/withName', { + params: { filter: JSON.stringify(expectedFilter) }, + }); + }); +}); From b466dfe034e3d13632e65359b43d5b04d491c02f Mon Sep 17 00:00:00 2001 From: provira Date: Thu, 9 Jan 2025 08:25:23 +0100 Subject: [PATCH 2/6] feat: refs #7055 added new test case --- .../__tests__/FilterItemForm.spec.js | 59 +++++++++++-------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/src/components/__tests__/FilterItemForm.spec.js b/src/components/__tests__/FilterItemForm.spec.js index f36a479d9..0c88bf421 100644 --- a/src/components/__tests__/FilterItemForm.spec.js +++ b/src/components/__tests__/FilterItemForm.spec.js @@ -1,6 +1,6 @@ import { createWrapper, axios } from 'app/test/vitest/helper'; import FilterItemForm from 'components/FilterItemForm.vue'; -import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest'; +import { vi, beforeAll, describe, expect, it } from 'vitest'; describe('FilterItemForm', () => { let vm; @@ -15,40 +15,42 @@ describe('FilterItemForm', () => { vm = wrapper.vm; wrapper = wrapper.wrapper; - vi.spyOn(axios, 'get').mockResolvedValue({ data: [] }); + vi.spyOn(axios, 'get').mockResolvedValue({ + data: [ + { + id: 999996, + name: 'Bolas de madera', + size: 2, + inkFk: null, + producerFk: null, + }, + ], + }); }); - it('should set up itemFilter and itemFilterParams correctly', async () => { + it('should filter data and populate tableRows for table display', async () => { wrapper.setProps({ itemFilter: { - include: [ - { relation: 'producer', scope: { fields: ['name'] } }, - { relation: 'ink', scope: { fields: ['name'] } }, - ], - where: { name: { like: '%bolas de madera%' } }, + include: [ + { relation: 'producer', scope: { fields: ['name'] } }, + { relation: 'ink', scope: { fields: ['name'] } }, + ], + where: { name: { like: '%bolas de madera%' } }, }, itemFilterParams: { name: 'bolas de madera' }, - }); + }); await vm.onSubmit(); - const expectedFilter = { - include: [ - { relation: 'producer', scope: { fields: ['name'] } }, - { relation: 'ink', scope: { fields: ['name'] } }, - ], - where: { - name: { like: '%bolas de madera%' }, - size: 'large', - producerFk: 1, - typeFk: 2, - inkFk: 3, + expect(vm.tableRows).toEqual([ + { + id: 999996, + name: 'Bolas de madera', + size: 2, + inkFk: null, + producerFk: null, }, - }; - - expect(axios.get).toHaveBeenCalledWith('Items/withName', { - params: { filter: JSON.stringify(expectedFilter) }, - }); + ]); }); it('should handle an empty itemFilterParams correctly', async () => { @@ -68,4 +70,9 @@ describe('FilterItemForm', () => { params: { filter: JSON.stringify(expectedFilter) }, }); }); -}); + + it('should emit "itemSelected" with the correct id and close the form', () => { + vm.selectItem({ id: 12345 }); + expect(wrapper.emitted('itemSelected')[0]).toEqual([12345]); + }); +}); \ No newline at end of file From 50008ce7f1305b7f8a6eb2648cd79446d6a78180 Mon Sep 17 00:00:00 2001 From: provira Date: Mon, 13 Jan 2025 12:27:26 +0100 Subject: [PATCH 3/6] fix: refs #7055 #7055 #7055 fixed some tests --- .../__tests__/FilterItemForm.spec.js | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/components/__tests__/FilterItemForm.spec.js b/src/components/__tests__/FilterItemForm.spec.js index 0c88bf421..210d6bf02 100644 --- a/src/components/__tests__/FilterItemForm.spec.js +++ b/src/components/__tests__/FilterItemForm.spec.js @@ -1,5 +1,5 @@ import { createWrapper, axios } from 'app/test/vitest/helper'; -import FilterItemForm from 'components/FilterItemForm.vue'; +import FilterItemForm from 'src/components/FilterItemForm.vue'; import { vi, beforeAll, describe, expect, it } from 'vitest'; describe('FilterItemForm', () => { @@ -19,7 +19,7 @@ describe('FilterItemForm', () => { data: [ { id: 999996, - name: 'Bolas de madera', + name: 'bolas de madera', size: 2, inkFk: null, producerFk: null, @@ -29,23 +29,26 @@ describe('FilterItemForm', () => { }); it('should filter data and populate tableRows for table display', async () => { - wrapper.setProps({ - itemFilter: { - include: [ - { relation: 'producer', scope: { fields: ['name'] } }, - { relation: 'ink', scope: { fields: ['name'] } }, - ], - where: { name: { like: '%bolas de madera%' } }, - }, - itemFilterParams: { name: 'bolas de madera' }, - }); + vm.itemFilterParams.name = 'bolas de madera'; await vm.onSubmit(); + const expectedFilter = { + include: [ + { relation: 'producer', scope: { fields: ['name'] } }, + { relation: 'ink', scope: { fields: ['name'] } }, + ], + where: {"name":{"like":"%bolas de madera%"}}, + }; + + expect(axios.get).toHaveBeenCalledWith('Items/withName', { + params: { filter: JSON.stringify(expectedFilter) }, + }); + expect(vm.tableRows).toEqual([ { id: 999996, - name: 'Bolas de madera', + name: 'bolas de madera', size: 2, inkFk: null, producerFk: null, @@ -54,6 +57,7 @@ describe('FilterItemForm', () => { }); it('should handle an empty itemFilterParams correctly', async () => { + vm.itemFilterParams.name = null; vm.itemFilterParams = {}; await vm.onSubmit(); From dbafd5d6899d5875009fb381aa361fb23c57b2e5 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 13 Jan 2025 15:24:20 +0100 Subject: [PATCH 4/6] build: refs #8389 changelog --- CHANGELOG.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6908d764a..a7797f810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,82 @@ +# Version 25.00 - 2025-01-14 + +### Added 🆕 + +- chore: refs #7056 move test by:jorgep +- feat: refs #7050 7050 add object check by:Jtubau +- feat: refs #7050 7050 add test to isEmpty() by:Jtubau +- feat: refs #7056 add tests in FormModel by:jorgep +- feat: refs #7056 update route meta information and add FormModel tests by:jorgep +- feat: refs #7074 tests for fns setData(), parseDms() and showFormDialog() (7074-makeFrontTestToVnDmsList) by:Jtubau +- feat: refs #7079 created VnLocation front test by:provira +- feat: refs #7189 add Accept-Language header to axios requests by:jorgep +- feat: refs #7924 add custom inspection checkbox and localization support by:jgallego +- feat: refs #7924 update custom inspection label for clarity in English and Spanish locales by:jgallego +- feat: refs #8004 enhance FetchedTags component with column support and styling updates by:pablone +- feat: refs #8004 hide rightFilter by:pablone +- feat: refs #8246 added new field in list by:Jon +- feat: refs #8266 added descriptor to item name by:jtubau +- feat: refs #8293 add zone filter by:Jtubau +- feat: refs #8293 include zone data in each record by:Jtubau +- fix: refs #8004 more list style issues by:pablone +- fix: refs #8004 some style issues on all list by:pablone +- style: refs #8004 update layout and styling in FetchedTags and ItemList components by:pablone +- style: update CustomerBalance.vue to set label color by:jgallego + +### Changed 📦 + +- perf: order by:alexm +- perf: redirect transition list to card by:alexm +- perf: refs #8201 onDataSaved fetch by:Jon +- perf: revert processData by:alexm +- perf: simplify if by:alexm +- perf: simplify if (perf_redirectTransition) by:alexm +- refactor: item fixedPrice by:Jon +- refactor: refs #7050 refactorize by:jtubau +- refactor: refs #7050 removed blank spaces by:jtubau +- refactor: refs #7052 move EditTableCellValueForm tests to a new location and enhance test coverage by:jgallego +- refactor: refs #7052 remove unnecessary console logs from EditTableCellValueForm tests by:jgallego +- refactor: refs #7074 move dms constant to global scope by:Jtubau +- refactor: refs #7079 removed useless code by:provira +- refactor: refs #7924 simplify custom inspection icon rendering in ExtraCommunity.vue by:jgallego +- refactor: refs #8004 remove console log from CardSummary component on mount by:pablone +- refactor: refs #8004 remove consoleLogs by:pablone +- refactor: refs #8004 remove unused stateStore import in InvoiceInList.vue by:pablone +- refactor: refs #8004 remove unused travelFilterRef and chip definition in TravelList.vue by:pablone +- refactor: refs #8004 replace VnSelect with VnSelectWorker in CustomerList component by:pablone +- refactor: refs #8201 added onMounted to stablish the value to show icons by:Jon +- refactor: refs #8201 deleted condition by:Jon +- refactor: refs #8201 deleted log by:Jon +- refactor: refs #8201 deleted logs by:Jon +- refactor: refs #8266 8266 change expedition item name by:Jtubau +- refactor: refs #8266 change expedition label by:Jtubau +- refactor: refs #8293 remove redundant attributes by:Jtubau +- refactor: refs #8320 changed folder names from "specs" to "**tests**" by:provira +- refactor: refs #8320 moved front tests to their respective sections by:provira +- refactor: refs #8813 removed unused class property by:provira + +### Fixed 🛠️ + +- fix: discount class by:PAU ROVIRA ROSALENY +- fix: duplicate transalation after test to dev by:alexm +- fix: fix translations by:carlossa +- fix: redirect to sales when confirming lines by:Jon +- fix: refs #7050 delete import added by mistake by:Jtubau +- fix: refs #7133 handleSalesModelValue function to handle empty input by:jorgep +- fix: refs #7189 update user language on sessionStorage by:jorgep +- fix: refs #7935 remove unused 'companyFk' column from InvoiceInList component by:jorgep +- fix: refs #8004 more list style issues by:pablone +- fix: refs #8004 some style issues on all list by:pablone +- fix: refs #8004 update label for daysOnward in TravelFilter component and add translations by:pablone +- fix: refs #8004 vnTable card with and add permanent labels by:pablone +- fix: refs #8201 added onDataSaved emi to refetch when cahnges are made by:Jon +- fix: refs #8201 use arrayData to fix the error by:Jon +- fix: refs #8314 space between label and value by:jtubau +- fix: refs #8813 fixed ClaimLines format by:provira +- fix: update button sizes in ExtraCommunity.vue for better visibility by:jgallego +- perf: revert processData by:alexm +- refactor: item fixedPrice by:Jon + # Version 24.52 - 2024-01-07 ### Added 🆕 From 099ea793bd1ecd01795d205f9a35b6efe361f5df Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 14 Jan 2025 07:29:44 +0100 Subject: [PATCH 5/6] fix: refs #8389 minor bugs --- src/components/ui/VnLinkPhone.vue | 2 +- src/pages/Customer/components/CustomerAddressEdit.vue | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ui/VnLinkPhone.vue b/src/components/ui/VnLinkPhone.vue index c5d5df394..a9e9bc0fc 100644 --- a/src/components/ui/VnLinkPhone.vue +++ b/src/components/ui/VnLinkPhone.vue @@ -30,7 +30,7 @@ onBeforeMount(async () => { .data; if (!channel) channel = defaultChannel; - phone.value = await parsePhone(props.phoneNumber, props.country.toLowerCase()); + phone.value = await parsePhone(props.phoneNumber, props.country?.toLowerCase()); config[ type ].url = `${url}?customerIdentity=%2B${phone.value}&channelId=${channel}`; diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index 6789ac56b..7685c55bc 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -248,12 +248,14 @@ function handleLocation(data, location) { clearable v-model="data.longitude" :decimal-places="7" + :positive="false" />

{{ t('Notes') }}

From 837c389f64f2694141803fe000187cb4afb67b86 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 14 Jan 2025 08:16:44 +0100 Subject: [PATCH 6/6] feat(cliamList): add auto-load, in this case they need it --- src/pages/Claim/ClaimList.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue index bb97162d8..3a44a1e77 100644 --- a/src/pages/Claim/ClaimList.vue +++ b/src/pages/Claim/ClaimList.vue @@ -142,6 +142,7 @@ const STATE_COLOR = { :columns="columns" redirect="claim" :right-search="false" + auto-load >