Adjusting unit test for new radio

This commit is contained in:
Max 2021-11-23 16:54:34 -05:00
parent 180e7ded39
commit 3b3af03d8f

View file

@ -2,22 +2,21 @@ import { shallowMount } from "@vue/test-utils";
import radio from "./radio"; import radio from "./radio";
describe("radio.vue", () => { describe("radio.vue", () => {
it("Should render the 'text' prop value as a span value for the radio button label and add the 'value' prop value as the radio button value and id.", () => { it("Should render the 'radioID' prop value as a span value for the radio button label.", () => {
// Act // Act
const wrapper = shallowMount(radio, { const wrapper = shallowMount(radio, {
propsData: { propsData: {
value: "2023", radioID: "2023",
text: "12", groupName: "TestGroup"
}, },
}); });
// Assert // Assert
expect(wrapper.find("span").text()).toEqual("12");
expect(wrapper.find("input").attributes()).toEqual({ expect(wrapper.find("input").attributes()).toEqual({
class: "position-absolute opacity-0",
id: "2023", id: "2023",
type: "radio", type: "radio",
value: "2023", value: "2023",
}); name: "TestGroup",
})
}); });
}); });