From aefe924060812f2f7f21d9030e8016c55ced4c49 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Thu, 29 Jun 2023 06:30:49 -0400 Subject: [PATCH 1/4] swapped crypto with uuid() for generating ids for components when customId is not supplied --- .../button-question/button-question.spec.js | 3 --- .../dropdown-question/dropdown-question.spec.js | 4 +--- .../dropdown-question/dropdown-question.vue | 12 ++++++------ src/digital-components/modal/modal.spec.js | 4 +--- src/digital-components/modal/modal.vue | 5 ++++- .../textbox-question/textbox-question.spec.js | 3 --- .../textbox-question/textbox-question.vue | 7 ++++--- .../content-group-modal/content-group-modal.spec.js | 3 --- .../address-questions/address-questions.vue | 4 ++-- .../mobile-location-modal-questions.spec.js | 5 ----- .../mobile-location-modal-questions.vue | 4 +++- .../service-zip-modal-question.spec.js | 2 -- 12 files changed, 21 insertions(+), 35 deletions(-) diff --git a/src/digital-components/button-question/button-question.spec.js b/src/digital-components/button-question/button-question.spec.js index ce8d87fab..e9e1d70a4 100644 --- a/src/digital-components/button-question/button-question.spec.js +++ b/src/digital-components/button-question/button-question.spec.js @@ -1,9 +1,6 @@ import { shallowMount, mount } from "@vue/test-utils"; import buttonQuestion from "./button-question"; import { getMountOptions } from "@/helpers/unit-test-helper.js"; -import crypto from "crypto"; - -global.crypto = crypto; describe("buttonQuestion.vue", () => { it("Should show overflow classes on fieldset if isOverflowScrollable is true", () => { diff --git a/src/digital-components/dropdown-question/dropdown-question.spec.js b/src/digital-components/dropdown-question/dropdown-question.spec.js index 654709926..8d7a28a85 100644 --- a/src/digital-components/dropdown-question/dropdown-question.spec.js +++ b/src/digital-components/dropdown-question/dropdown-question.spec.js @@ -1,6 +1,6 @@ import { shallowMount } from "@vue/test-utils"; import dropdownQuestion from "./dropdown-question"; -import crypto from "crypto"; + // Mock CMS content const questionText = "Question Text"; @@ -12,8 +12,6 @@ const mockMixin = { }, }; -global.crypto = crypto; - // TODO: Remove the following from dropdown-question.vue -> :class="(errors && errors.length) || hasError ? 'has-error' : ''" // It is not being used. describe("dropdownQuestion.vue", () => { diff --git a/src/digital-components/dropdown-question/dropdown-question.vue b/src/digital-components/dropdown-question/dropdown-question.vue index 5c32b298c..044b28a6c 100644 --- a/src/digital-components/dropdown-question/dropdown-question.vue +++ b/src/digital-components/dropdown-question/dropdown-question.vue @@ -30,27 +30,27 @@