Skip to content

Commit 6b5e38d

Browse files
committed
fix(tests): use getComponent with name
1 parent aa09e87 commit 6b5e38d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Indicators.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { mount } from "@vue/test-utils";
33
import { describe, expect, it } from "vitest";
44
import ChevronDownIcon from "./icons/ChevronDownIcon.vue";
55
import XMarkIcon from "./icons/XMarkIcon.vue";
6-
import Indicators from "./Indicators.vue";
76
import Select from "./Select.vue";
87
import Spinner from "./Spinner.vue";
98

@@ -65,7 +64,7 @@ describe("dropdown button rendering", () => {
6564

6665
it("should emit toggle event when dropdown button is clicked", async () => {
6766
const wrapper = mount(Select, { props: defaultProps });
68-
const indicators = wrapper.findComponent(Indicators);
67+
const indicators = wrapper.getComponent({ name: "Indicators" });
6968

7069
await wrapper.find(".dropdown-icon").trigger("click");
7170
expect(indicators.emitted("toggle")).toStrictEqual([[]]);
@@ -138,7 +137,7 @@ describe("clear button behavior", () => {
138137

139138
it("should emit clear event when clear button is clicked", async () => {
140139
const wrapper = mount(Select, { props: defaultProps });
141-
const indicators = wrapper.findComponent(Indicators);
140+
const indicators = wrapper.getComponent({ name: "Indicators" });
142141

143142
await wrapper.get("input").trigger("mousedown");
144143
await dispatchEvent(wrapper, new KeyboardEvent("keydown", { key: "Enter" }));

0 commit comments

Comments
 (0)