diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index 7fff5c238..0799446d5 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -7,9 +7,9 @@
{{groupName}}
- diff --git a/src/layouts/component-test/component-test.vue b/src/layouts/component-test/component-test.vue index c4c7e4415..3f1ae5ad9 100644 --- a/src/layouts/component-test/component-test.vue +++ b/src/layouts/component-test/component-test.vue @@ -18,24 +18,30 @@

Radio Button

-

Sample radio button group

+

Sample radio button group

@@ -74,14 +80,17 @@





{ + it("Should return group name", async () => { + // Act + const wrapper = shallowMount(radio, { + propsData: { + groupName: "radio-button-test", + }, + }); + + // Assert + const input = wrapper.find("input"); + + // Expect + expect(input.attributes().name).toEqual("radio-button-test"); + }); + + it("Should return checkbox id", async () => { + // Act + const wrapper = shallowMount(radio, { + propsData: { + buttonID: "Radio ID", + }, + }); + + // Assert + const input = wrapper.find("input"); + + // Expect + expect(input.attributes().id).toEqual("Radio ID"); + }); + + it("Should return label text", async () => { + // Act + const wrapper = shallowMount(radio, { + propsData: { + buttonLabel: "label text", + }, + }); + + // Assert + const paragraph = wrapper.find("p"); + + expect(paragraph.text()).toEqual("label text"); + }); + + it("Should return label text", async () => { + // Act + const wrapper = shallowMount(radio, { + propsData: { + screenReaderOnlyText: "screenreader text", + }, + }); + + // Assert + const paragraph = wrapper.find("span"); + + expect(paragraph.text()).toEqual("screenreader text"); + }); +}); diff --git a/src/ux-components/radio/radio.vue b/src/ux-components/radio/radio.vue index e2cd08669..3cc17987c 100644 --- a/src/ux-components/radio/radio.vue +++ b/src/ux-components/radio/radio.vue @@ -1,16 +1,18 @@ @@ -52,7 +97,7 @@ export default { content: ""; position: relative; display: inline-block; - margin-right: 10px; + margin-right: 8px; width: 16px; height: 16px; background: white;