Fixed broken unit test and removed test no longer needed

This commit is contained in:
Leah Schumann 2023-07-10 10:27:10 -04:00
parent 71555378d5
commit 9e08f5d259

View file

@ -4,6 +4,8 @@ import textareaQuestion from "./textarea-question";
// Supporting Files
import { shallowMount } from "@vue/test-utils";
const maska = jest.fn();
const questionText = "textareaQuestionText";
const mockMixin = {
methods: {
@ -17,6 +19,11 @@ describe("textarea-question.vue", () => {
it("Should render a textarea", async () => {
// Arrange
const wrapper = shallowMount(textareaQuestion, {
global: {
directives: {
maska: maska,
},
},
propsData: {
modelValue: "",
},
@ -35,6 +42,11 @@ describe("textarea-question.vue", () => {
it("Should emit new value when modelValue is changed", async () => {
// Act
const wrapper = shallowMount(textareaQuestion, {
global: {
directives: {
maska: maska,
},
},
propsData: {
modelValue: "val",
},
@ -47,19 +59,4 @@ describe("textarea-question.vue", () => {
expect(wrapper.emitted("update:modelValue")).toEqual([["val2"]]);
});
it("Should limit the number of characters entered to the max length value property passed in", async () => {
// Act
const wrapper = shallowMount(textareaQuestion, {
propsData: {
modelValue: "123456789",
maxLength: 10,
},
mixins: [mockMixin],
});
wrapper.vm.value = "12345678910";
// Assert
expect(wrapper.vm.value).toEqual("1234567891");
});
});