diff --git a/src/boot/__tests__/axios.spec.js b/src/boot/__tests__/axios.spec.js index 85d578517f6..45a3cc7f01e 100644 --- a/src/boot/__tests__/axios.spec.js +++ b/src/boot/__tests__/axios.spec.js @@ -67,7 +67,7 @@ describe('Axios boot', () => { }; const result = onResponseError(error); - expect(result).rejects.toEqual(expect.objectContaining(error)); + await expect(result).rejects.toEqual(expect.objectContaining(error)); }); it('should call to the Notify plugin with a message from the response property', async () => { @@ -83,7 +83,7 @@ describe('Axios boot', () => { }; const result = onResponseError(error); - expect(result).rejects.toEqual(expect.objectContaining(error)); + await expect(result).rejects.toEqual(expect.objectContaining(error)); }); }); }); diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index a57e2c01c28..f6a606547d2 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -20,7 +20,6 @@ const postcodeFormData = reactive({ provinceFk: null, townFk: null, }); -const townFilter = ref({}); const countriesRef = ref(false); const provincesOptions = ref([]); @@ -33,11 +32,11 @@ function onDataSaved(formData) { newPostcode.town = town.value.name; newPostcode.townFk = town.value.id; const provinceObject = provincesOptions.value.find( - ({ id }) => id === formData.provinceFk + ({ id }) => id === formData.provinceFk, ); newPostcode.province = provinceObject?.name; const countryObject = countriesRef.value.opts.find( - ({ id }) => id === formData.countryFk + ({ id }) => id === formData.countryFk, ); newPostcode.country = countryObject?.name; emit('onDataSaved', newPostcode); @@ -67,21 +66,11 @@ function setTown(newTown, data) { } async function onCityCreated(newTown, formData) { newTown.province = provincesOptions.value.find( - (province) => province.id === newTown.provinceFk + (province) => province.id === newTown.provinceFk, ); formData.townFk = newTown; setTown(newTown, formData); } - -async function filterTowns(name) { - if (name !== '') { - townFilter.value.where = { - name: { - like: `%${name}%`, - }, - }; - } -}