Skip to content

Commit 18c4aad

Browse files
luizhf42gustavosbarreto
authored andcommitted
test(ui): mock fetchDeviceList in web endpoints test
1 parent 81b9105 commit 18c4aad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ui/tests/views/WebEndpoints.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { router } from "@/router";
1111
import useWebEndpointsStore from "@/store/modules/web_endpoints";
1212
import { IWebEndpoint } from "@/interfaces/IWebEndpoints";
1313
import useAuthStore from "@/store/modules/auth";
14+
import useDevicesStore from "@/store/modules/devices";
1415

1516
type WebEndpointsWrapper = VueWrapper<InstanceType<typeof WebEndpoints>>;
1617

@@ -38,9 +39,12 @@ describe("WebEndpoints.vue", () => {
3839
const mockWebEndpointsApi = new MockAdapter(webEndpointsApi.getAxios());
3940
setActivePinia(createPinia());
4041
const authStore = useAuthStore();
42+
const devicesStore = useDevicesStore();
4143
const webEndpointsStore = useWebEndpointsStore();
4244
const vuetify = createVuetify();
4345

46+
devicesStore.fetchDeviceList = vi.fn().mockResolvedValue([]);
47+
4448
beforeEach(async () => {
4549
mockWebEndpointsApi
4650
.onGet("http://localhost:3000/api/web-endpoints?page=1&per_page=10")

0 commit comments

Comments
 (0)