DigitalConsumer.FixMyGlass/src/common-components/textbox-question/textbox-question.spec.js
2022-03-22 09:10:43 -04:00

81 lines
1.7 KiB
JavaScript

import { shallowMount } from "@vue/test-utils";
import textboxQuestion from "./textbox-question";
import { nextTick } from "vue";
describe("textboxQuestion.vue", () => {
/* it("Should return aria-disabled state", async () => {
// Act
const wrapper = shallowMount(textboxQuestion, {
propsData: {
isDisabled: true,
},
});
// Assert
const input = wrapper.find("input");
// Expect
expect(input.attributes()["aria-disabled"]).toEqual("true");
}); */
/* it("Should render a text input", async () => {
// Act
const wrapper = shallowMount(textboxQuestion, {
propsData: {
name: "test",
label: "unit test label",
},
});
// Assert
const input = wrapper.find("input");
expect(input.exists()).toBe(true);
});
it("Should return input id", async () => {
// Act
const wrapper = shallowMount(textboxQuestion, {
propsData: {
inputId: "input ID",
},
});
// Assert
const input = wrapper.find("input");
// Expect
expect(input.attributes().id).toEqual("input ID");
}); */
it("Should return label text", async () => {
// Act
const wrapper = shallowMount(textboxQuestion, {
propsData: {
labelText: "label text",
},
});
// Assert
const label = wrapper.find("label");
expect(label.text()).toEqual("label text");
});
/* it("Should return input id", async () => {
// Act
const wrapper = shallowMount(textboxQuestion, {
propsData: {
inputId: "input ID",
},
});
// Assert
const input = wrapper.find("input");
// Expect
expect(input.attributes().id).toEqual("input ID");
}); */
});