Skip to content

Commit 4157ceb

Browse files
committed
adding test cases in ApplyFilterButton.spec.js
1 parent e8980fc commit 4157ceb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/Registry/__tests__/ApplyFilterButton.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { createVuetify } from "vuetify";
33
import { beforeEach, describe, expect, it } from "vitest";
44
import ApplyFilterButton from "../ApplyFilterButton.vue";
55
import { createPinia, setActivePinia } from "pinia";
6+
import { useAdvancedSearchStore } from "@/stores/advancedSearch.js";
67

78
const vuetify = createVuetify();
89

@@ -20,6 +21,14 @@ describe("ApplyFilterButton.vue", function () {
2021
});
2122

2223
it("can be instantiated", () => {
24+
wrapper.vm.$options.watch.getFairassistID.call(wrapper.vm, 12);
2325
expect(wrapper.vm.$options.name).toMatch("ApplyFilterButton");
2426
});
27+
28+
it("check fetchAdvancedSearchResults called on click of 'Apply Filter' button", () => {
29+
const store = useAdvancedSearchStore();
30+
const applyFilterButton = wrapper.get("[data-testid='applyFilter']");
31+
applyFilterButton.trigger("click");
32+
expect(store.fetchAdvancedSearchResults()).toHaveBeenCalled;
33+
});
2534
});

0 commit comments

Comments
 (0)