WIP update unit test to correct failure.

This commit is contained in:
bmauger 2021-12-03 09:05:50 -05:00
parent 412999fcea
commit 99aa3e41ea
2 changed files with 5 additions and 5 deletions

View file

@ -1,10 +1,10 @@
import { shallowMount } from "@vue/test-utils";
import radio from "./radio";
import radioHorizontal from "./radio-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 () => {
// Act
const wrapper = shallowMount(radio, {
const wrapper = shallowMount(radioHorizontal, {
propsData: {
radioID: "2023",
groupName: "TestGroup",
@ -31,9 +31,9 @@ describe("radio.vue", () => {
expect(label.attributes()).toEqual({
role: "radio",
tabindex: "0",
tabindex: "-1",
for: "2023",
class: "d-flex flex-column justify-content-center py-3 px-4",
class: "d-flex flex-column justify-content-center py-3 px-4 last-item",
"aria-checked": "false"
});

View file

@ -1,7 +1,7 @@
<template>
<div class="col radiogroup radio-horizontal d-flex flex-column mb-2">
<input type="radio" :id="radioID" :name="groupName" :value="radioID">
<label role="radio" tabindex="0" aria-checked="false" :for="radioID" class="d-flex flex-column justify-content-center py-3 px-4" :class="isFirstOrLastItem" @click='displayComponent'>
<label role="radio" tabindex="-1" aria-checked="false" :for="radioID" class="d-flex flex-column justify-content-center py-3 px-4" :class="isFirstOrLastItem" @click='displayComponent'>
<span class="m-0" :class="[this.textPosition]">{{radioID}}</span>
<span class="m-0 small" :class="[this.textPosition]">{{radioLabelSubCopy}}</span>
<loader v-if="display" :style="{width: `${sizeInRem}rem`, height: `${sizeInRem}rem`}" :class="[this.loaderColor, this.loaderPosition]" />