diff --git a/src/ux-components/list-card/list-card.spec.js b/src/ux-components/list-card/list-card.spec.js index 3d0843e10..736fed6b9 100644 --- a/src/ux-components/list-card/list-card.spec.js +++ b/src/ux-components/list-card/list-card.spec.js @@ -1 +1,65 @@ -test.todo("some test to be written in the future"); +import { shallowMount } from "@vue/test-utils"; +import listCard from "./list-card"; + +describe("list-card.vue", () => { + + it("Should return input type checkbox if isMultiSelect is true", async () => { + // Act + const wrapper = shallowMount(listCard, { + propsData: { + isMultiSelect: true, + buttonLabel: "Windshield", + buttonID: "List Card Checkbox", + groupID: "checkbox-demo-1", + groupName: "Checkbox 1", + buttonImage: "windshield-damage.svg", + }, + }); + + // Assert + const input = wrapper.find("input"); + + expect(input.attributes().type).toEqual("checkbox"); + }); + + it("Should return input type radio if isRadio is true", async () => { + // Act + const wrapper = shallowMount(listCard, { + propsData: { + isRadio: true, + buttonLabel: "Windshield", + buttonID: "List Card Checkbox", + groupID: "radio-demo-1", + groupName: "radio 1", + buttonImage: "windshield-damage.svg", + }, + }); + + // Assert + const input = wrapper.find("input"); + + expect(input.attributes().type).toEqual("radio"); + }); + + it("Should return input type checkbox and class horizontal if isMultiSelectHorizontal is true", async () => { + // Act + const wrapper = shallowMount(listCard, { + propsData: { + isMultiSelectHorizontal: true, + buttonLabel: "Windshield", + buttonID: "List Card Checkbox", + groupID: "radio-demo-1", + groupName: "radio 1", + buttonImage: "windshield-damage.svg", + class: "horizontal" + }, + }); + + // Assert + const input = wrapper.find("input"); + + expect(input.attributes().type).toEqual("checkbox"); + + }); + +}); diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index 177d43e90..3d2c807bb 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -5,7 +5,7 @@
{{buttonLabel}}
-{{buttonLabelSubCopy}}
+{{buttonLabelSubCopy}}
{{buttonLabel}}
-{{buttonLabelSubCopy}}
+{{buttonLabelSubCopy}}