From 6349a3e790db734d0d0f0208b71dc065cbab0a49 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 9 Apr 2024 15:08:54 +0200 Subject: [PATCH] feat: refs #6992 comments --- src/composables/useArrayData.js | 3 +-- test/vitest/__tests__/composables/useArrayData.spec.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index a212cb744..2c5a579c8 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -1,5 +1,5 @@ import { onMounted, ref, computed } from 'vue'; -import { useRouter, useRoute } from 'vue-router'; +import { useRoute } from 'vue-router'; import axios from 'axios'; import { useArrayDataStore } from 'stores/useArrayDataStore'; import { buildFilter } from 'filters/filterPanel'; @@ -15,7 +15,6 @@ export function useArrayData(key, userOptions) { const store = arrayDataStore.get(key); const hasMoreData = ref(false); - const router = useRouter(); const route = useRoute(); let canceller = null; diff --git a/test/vitest/__tests__/composables/useArrayData.spec.js b/test/vitest/__tests__/composables/useArrayData.spec.js index 09bfc256f..ae0ca7368 100644 --- a/test/vitest/__tests__/composables/useArrayData.spec.js +++ b/test/vitest/__tests__/composables/useArrayData.spec.js @@ -11,7 +11,11 @@ describe('useArrayData', () => { writable: true, value: 'localhost:9000/invoice-in/list', }); + + // Mock the window.history.pushState method within useArrayData window.history.pushState = (data, title, url) => (window.location.href = url); + + // Mock the URL constructor within useArrayData global.URL = class URL { constructor(url) { this.hash = url.split('localhost:9000/')[1];