From f6e4cefb172d869620c7e8fa517de197c2f6c8ae Mon Sep 17 00:00:00 2001 From: Will Sheldon <114631109+wssheldon@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:19:15 -0800 Subject: [PATCH] lint: resolve eslint error level lint checks --- src/dispatch/static/dispatch/src/auth/Mfa.vue | 2 +- .../static/dispatch/src/tests/Mfa.spec.js | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/dispatch/static/dispatch/src/auth/Mfa.vue b/src/dispatch/static/dispatch/src/auth/Mfa.vue index f0d54f58fbf4..50f83ca7ec87 100644 --- a/src/dispatch/static/dispatch/src/auth/Mfa.vue +++ b/src/dispatch/static/dispatch/src/auth/Mfa.vue @@ -23,7 +23,7 @@ :type="alertType" :icon="statusIcon" class="mb-4" - border="left" + border="start" > {{ statusMessage }} diff --git a/src/dispatch/static/dispatch/src/tests/Mfa.spec.js b/src/dispatch/static/dispatch/src/tests/Mfa.spec.js index 24e0e6c7d638..970305938dad 100644 --- a/src/dispatch/static/dispatch/src/tests/Mfa.spec.js +++ b/src/dispatch/static/dispatch/src/tests/Mfa.spec.js @@ -6,7 +6,6 @@ import * as directives from "vuetify/directives" import MfaVerification from "@/auth/mfa.vue" import authApi from "@/auth/api" -// Mock vue-router vi.mock("vue-router", () => ({ useRoute: () => ({ query: { @@ -17,7 +16,6 @@ vi.mock("vue-router", () => ({ }), })) -// Mock auth API vi.mock("@/auth/api", () => ({ default: { verifyMfa: vi.fn(), @@ -31,19 +29,24 @@ const vuetify = createVuetify({ global.ResizeObserver = require("resize-observer-polyfill") -const originalWindow = window const windowCloseMock = vi.fn() +const originalClose = window.close beforeEach(() => { vi.useFakeTimers() - // @ts-ignore - window.close = windowCloseMock + Object.defineProperty(window, "close", { + value: windowCloseMock, + writable: true, + }) vi.clearAllMocks() }) afterEach(() => { vi.useRealTimers() - window = originalWindow + Object.defineProperty(window, "close", { + value: originalClose, + writable: true, + }) }) test("mounts correctly and starts verification automatically", async () => {