diff --git a/src/common-components/radio-question/radio-question.spec.js b/src/common-components/button-question/button-question.spec.js
similarity index 53%
rename from src/common-components/radio-question/radio-question.spec.js
rename to src/common-components/button-question/button-question.spec.js
index de6458122..df7b834c8 100644
--- a/src/common-components/radio-question/radio-question.spec.js
+++ b/src/common-components/button-question/button-question.spec.js
@@ -1,10 +1,10 @@
import { shallowMount } from "@vue/test-utils";
-import radioQuestion from "@/common-components/radio-question/radio-question";
+import buttonQuestion from "@/common-components/button-question/button-question";
-describe("radioQuestion.vue", () => {
- it("Should render the 'questionText' prop value as a span value for the radio question and the 'answer' values should render as text values for radio components.", async () => {
+describe("buttonQuestion.vue", () => {
+ it("Should render the 'questionText' prop value as a span value for the button question and the 'answer' values should render as text values for button components.", async () => {
// Act
- const wrapper = shallowMount(radioQuestion);
+ const wrapper = shallowMount(buttonQuestion);
await wrapper.setProps({
questionText: "Question Text",
answers: ["2023", "2022", "2021"],
@@ -16,8 +16,8 @@ describe("radioQuestion.vue", () => {
expect(wrapper.find(".needed_car_info-text").text()).toEqual(
"Question Text"
);
- const radioButtons = wrapper.findAllComponents('[data-test="radio"]');
- expect(radioButtons.length).toBe(3);
+ const buttonButtons = wrapper.findAllComponents('[data-test="button"]');
+ expect(buttonButtons.length).toBe(3);
expect(wrapper.props().modelValue).toBe("2020");
});
});
diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue
new file mode 100644
index 000000000..97ebf1310
--- /dev/null
+++ b/src/common-components/button-question/button-question.vue
@@ -0,0 +1,48 @@
+
+
@@ -16,3 +14,9 @@ export default {
},
};
+
+
diff --git a/src/ux-components/radio-horizontal/radio-horizontal.spec.js b/src/ux-components/list-button-horizontal/list-button-horizontal.spec.js
similarity index 70%
rename from src/ux-components/radio-horizontal/radio-horizontal.spec.js
rename to src/ux-components/list-button-horizontal/list-button-horizontal.spec.js
index c12eedefa..ac8dc3202 100644
--- a/src/ux-components/radio-horizontal/radio-horizontal.spec.js
+++ b/src/ux-components/list-button-horizontal/list-button-horizontal.spec.js
@@ -1,12 +1,12 @@
import { shallowMount } from "@vue/test-utils";
-import radioHorizontal from "./radio-horizontal";
+import listButtonHorizontal from "./list-button-horizontal";
-describe("radio.vue", () => {
- it("Should render the 'radioID' prop value as the label and id value as well as the radio button value, groupName as the name value, and fire a click even that sets the display data attribute to true.", async () => {
+describe("list-button.vue", () => {
+ it("Should render the 'buttonID' prop value as the label and id value as well as the button value, groupName as the name value, and fire a click even that sets the display data attribute to true.", async () => {
// Act
- const wrapper = shallowMount(radioHorizontal, {
+ const wrapper = shallowMount(listButtonHorizontal, {
propsData: {
- radioID: "2023",
+ buttonID: "2023",
groupName: "TestGroup",
loaderColor: "blue",
loaderPosition: "right",
diff --git a/src/ux-components/list-button-horizontal/list-button-horizontal.vue b/src/ux-components/list-button-horizontal/list-button-horizontal.vue
new file mode 100644
index 000000000..315a18995
--- /dev/null
+++ b/src/ux-components/list-button-horizontal/list-button-horizontal.vue
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
{{ errorMessage }}
+
+
+
+
+
diff --git a/src/ux-components/list-button/list-button.spec.js b/src/ux-components/list-button/list-button.spec.js
index 3d0843e10..599d447f4 100644
--- a/src/ux-components/list-button/list-button.spec.js
+++ b/src/ux-components/list-button/list-button.spec.js
@@ -1 +1,47 @@
-test.todo("some test to be written in the future");
+import { shallowMount } from "@vue/test-utils";
+import listButton from "./list-button";
+
+describe("list-button.vue", () => {
+ it("Should render the 'buttonID' prop value as the label and id value as well as the button value, groupName as the name value, and fire a click even that sets the display data attribute to true.", async () => {
+ // Act
+ const wrapper = shallowMount(listButton, {
+ propsData: {
+ buttonID: "2023",
+ groupName: "TestGroup",
+ loaderColor: "blue",
+ loaderPosition: "right",
+ sizeInRem: "1.5",
+ errorMessage: "null",
+ },
+ });
+
+ // Assert
+ const input = wrapper.find("input");
+ const label = wrapper.find("label");
+ const paragraph = wrapper.find("span");
+
+ await label.trigger("click");
+
+ expect(input.attributes()).toEqual({
+ id: "2023",
+ type: "radio",
+ value: "2023",
+ name: "TestGroup",
+ "aria-required": "false",
+ });
+
+ expect(label.attributes()).toEqual({
+ role: "radio",
+ tabindex: "-1",
+ for: "2023",
+ class: "d-flex flex-column justify-content-center py-3 px-4",
+ "aria-checked": "false",
+ });
+
+ expect(label.text()).toEqual("2023");
+
+ expect(paragraph.text()).toEqual("2023");
+
+ expect(wrapper.vm.display).toBe(true);
+ });
+});
diff --git a/src/ux-components/list-button/list-button.vue b/src/ux-components/list-button/list-button.vue
index 52997d5d6..e23a96dfc 100644
--- a/src/ux-components/list-button/list-button.vue
+++ b/src/ux-components/list-button/list-button.vue
@@ -1,27 +1,15 @@
-
-
-
-
+
+
+
+
+
{{errorMessage}}
+
diff --git a/src/ux-components/list-card/list-card.spec.js b/src/ux-components/list-card/list-card.spec.js
new file mode 100644
index 000000000..3d0843e10
--- /dev/null
+++ b/src/ux-components/list-card/list-card.spec.js
@@ -0,0 +1 @@
+test.todo("some test to be written in the future");
diff --git a/src/ux-components/radio-card/radio-card.vue b/src/ux-components/list-card/list-card.vue
similarity index 78%
rename from src/ux-components/radio-card/radio-card.vue
rename to src/ux-components/list-card/list-card.vue
index 0789827ef..be7434cc4 100644
--- a/src/ux-components/radio-card/radio-card.vue
+++ b/src/ux-components/list-card/list-card.vue
@@ -1,25 +1,25 @@
-
+
@@ -28,13 +28,13 @@
diff --git a/src/ux-components/radio/radio.spec.js b/src/ux-components/radio/radio.spec.js
deleted file mode 100644
index c1b726dca..000000000
--- a/src/ux-components/radio/radio.spec.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import { shallowMount } from "@vue/test-utils";
-import radio from "./radio";
-
-describe("radio.vue", () => {
- it("Should render the 'radioID' prop value as the label and id value as well as the radio button value, groupName as the name value, and fire a click even that sets the display data attribute to true.", async () => {
- // Act
- const wrapper = shallowMount(radio, {
- propsData: {
- radioID: "2023",
- groupName: "TestGroup",
- loaderColor: "blue",
- loaderPosition: "right",
- sizeInRem: "1.5",
- errorMessage: "null",
- },
- });
-
- // Assert
- const input = wrapper.find("input");
- const label = wrapper.find("label");
- const paragraph = wrapper.find("span");
-
- await label.trigger("click");
-
- expect(input.attributes()).toEqual({
- id: "2023",
- type: "radio",
- value: "2023",
- name: "TestGroup",
- "aria-required": "true",
- });
-
- expect(label.attributes()).toEqual({
- role: "radio",
- tabindex: "-1",
- for: "2023",
- class: "d-flex flex-column justify-content-center py-3 px-4",
- "aria-checked": "false",
- });
-
- expect(label.text()).toEqual("2023");
-
- expect(paragraph.text()).toEqual("2023");
-
- expect(wrapper.vm.display).toBe(true);
- });
-});
diff --git a/src/ux-components/radio/radio.vue b/src/ux-components/radio/radio.vue
deleted file mode 100644
index fbc7396b0..000000000
--- a/src/ux-components/radio/radio.vue
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-