Skip to content

Commit

Permalink
lint: resolve eslint error level lint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
wssheldon committed Nov 8, 2024
1 parent 3a157bb commit f6e4cef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/dispatch/static/dispatch/src/auth/Mfa.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:type="alertType"
:icon="statusIcon"
class="mb-4"
border="left"
border="start"
>
{{ statusMessage }}
</v-alert>
Expand Down
15 changes: 9 additions & 6 deletions src/dispatch/static/dispatch/src/tests/Mfa.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -17,7 +16,6 @@ vi.mock("vue-router", () => ({
}),
}))

// Mock auth API
vi.mock("@/auth/api", () => ({
default: {
verifyMfa: vi.fn(),
Expand All @@ -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 () => {
Expand Down

0 comments on commit f6e4cef

Please sign in to comment.