#6992 add URL params #273
|
@ -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;
|
||||
|
||||
|
|
|
@ -11,7 +11,11 @@ describe('useArrayData', () => {
|
|||
writable: true,
|
||||
value: 'localhost:9000/invoice-in/list',
|
||||
});
|
||||
|
||||
jorgep marked this conversation as resolved
Outdated
|
||||
// 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];
|
||||
|
|
Loading…
Reference in New Issue
No sé porque vitest no reconoce esta función, tampoco reconoce la clase URL, he tenido que simular el comportamiento.
hablas de la función de pushState?
sí
Poner comentario indicando que se está mockeando el método para usar dentro de useArrayData e igual para class URL