From 9e08f5d259c7d50111a15a40841c753481649bb9 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Mon, 10 Jul 2023 10:27:10 -0400 Subject: [PATCH] Fixed broken unit test and removed test no longer needed --- .../textarea-question.spec.js | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/digital-components/textarea-question/textarea-question.spec.js b/src/digital-components/textarea-question/textarea-question.spec.js index 93b6cad54..186a7ec1c 100644 --- a/src/digital-components/textarea-question/textarea-question.spec.js +++ b/src/digital-components/textarea-question/textarea-question.spec.js @@ -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"); - }); });