From 2dd28bf66c43b144627fe1c1d4f123789320c539 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 18 Oct 2023 20:37:37 -0400 Subject: [PATCH] Work around types in test code -- if we really want to do this, we should have a formal interface extension --- client/src/components/Common/ExportForm.test.ts | 5 ++++- client/src/components/User/UserDeletion.test.ts | 3 ++- client/tests/jest/helpers.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/components/Common/ExportForm.test.ts b/client/src/components/Common/ExportForm.test.ts index d2ae7d2422df..5c40a9fd62b0 100644 --- a/client/src/components/Common/ExportForm.test.ts +++ b/client/src/components/Common/ExportForm.test.ts @@ -43,7 +43,10 @@ describe("ExportForm.vue", () => { it("should localize button text", async () => { const newLocal = wrapper.find(".export-button").text(); - expect(newLocal).toBeLocalizationOf("Export"); + // TODO: fix typing, this is a jest matcher with a custom expect + // extension, or, just use vanilla javascript in test harness if there + // isn't significant value in typing here? + (expect(newLocal) as any).toBeLocalizationOf("Export"); }); it("should emit 'export' event with correct inputs on export button click", async () => { diff --git a/client/src/components/User/UserDeletion.test.ts b/client/src/components/User/UserDeletion.test.ts index 5e6f3ac7b972..1e2429faa05a 100644 --- a/client/src/components/User/UserDeletion.test.ts +++ b/client/src/components/User/UserDeletion.test.ts @@ -23,6 +23,7 @@ describe("UserDeletion.vue", () => { it("contains a localized link", async () => { const wrapper = mountComponent(); const el = await wrapper.find(ROOT_COMPONENT.preferences.delete_account.selector); - expect(el.text()).toBeLocalizationOf("Delete Account"); + // todo: fix typing, see note in ExportForm.test.ts + (expect(el.text()) as any).toBeLocalizationOf("Delete Account"); }); }); diff --git a/client/tests/jest/helpers.js b/client/tests/jest/helpers.js index d7de47030089..4c9a75f604e7 100644 --- a/client/tests/jest/helpers.js +++ b/client/tests/jest/helpers.js @@ -8,7 +8,7 @@ import { iconPlugin } from "components/plugins/icons"; import { localizationPlugin } from "components/plugins/localization"; import { vueRxShortcutPlugin } from "components/plugins/vueRxShortcuts"; import { PiniaVuePlugin } from "pinia"; -import { fromEventPattern,timer } from "rxjs"; +import { fromEventPattern, timer } from "rxjs"; import { debounceTime, take, takeUntil } from "rxjs/operators"; import _l from "utils/localization"; import Vuex from "vuex";