Skip to content

Commit

Permalink
Work around types in test code -- if we really want to do this, we sh…
Browse files Browse the repository at this point in the history
…ould have a formal interface extension
  • Loading branch information
dannon committed Oct 19, 2023
1 parent e96710f commit 2dd28bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion client/src/components/Common/ExportForm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/User/UserDeletion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
2 changes: 1 addition & 1 deletion client/tests/jest/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 2dd28bf

Please sign in to comment.