Skip to content

Commit

Permalink
test: anx-select
Browse files Browse the repository at this point in the history
test v-model when mounting with different default value
  • Loading branch information
pkrumplanx committed Aug 23, 2021
1 parent 8b10d3f commit 02e1131
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/AnxSelect/AnxSelect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ describe("AnxSelect.vue", () => {
paragraphWrapper.destroy();
});

it("has correct value when mounting", () => {
const options = [
{ value: "null", text: "Select something" },
{ value: "first", text: "first text" },
{ value: "second", text: "second text" }
];
const wrapper = mount(AnxSelect, {
propsData: { options, value: "second" }
});

expect(wrapper.get(".anx-select-div").text()).toBe(options[2].text);
});

it("emits event on selection change", async () => {
const options = [
{ value: "null", text: "Select something" },
Expand Down

0 comments on commit 02e1131

Please sign in to comment.