From 96610603cafb251f29d21f7616ec3447b07ca203 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 16 Oct 2024 07:14:45 +0200 Subject: [PATCH] UI: fix unit tests (#9798) --- ui/tests/unit/components/view/ActionButton.spec.js | 10 ++++++++++ ui/tests/unit/views/compute/MigrateWizard.spec.js | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/ui/tests/unit/components/view/ActionButton.spec.js b/ui/tests/unit/components/view/ActionButton.spec.js index 7e41f0bd2f8e..1565b471548d 100644 --- a/ui/tests/unit/components/view/ActionButton.spec.js +++ b/ui/tests/unit/components/view/ActionButton.spec.js @@ -23,6 +23,16 @@ import mockData from '../../../mockData/ActionButton.mock.json' import ActionButton from '@/components/view/ActionButton' jest.mock('axios', () => mockAxios) +jest.mock('@/vue-app', () => ({ + vueProps: { + $localStorage: { + set: jest.fn((key, value) => {}), + get: jest.fn((key) => { + return null + }) + } + } +})) let router, store, i18n const state = { diff --git a/ui/tests/unit/views/compute/MigrateWizard.spec.js b/ui/tests/unit/views/compute/MigrateWizard.spec.js index f352b2de2c49..d3ee49426dcb 100644 --- a/ui/tests/unit/views/compute/MigrateWizard.spec.js +++ b/ui/tests/unit/views/compute/MigrateWizard.spec.js @@ -23,6 +23,16 @@ import mockData from '../../../mockData/MigrateWizard.mock' import MigrateWizard from '@/views/compute/MigrateWizard' jest.mock('axios', () => mockAxios) +jest.mock('@/vue-app', () => ({ + vueProps: { + $localStorage: { + set: jest.fn((key, value) => {}), + get: jest.fn((key) => { + return null + }) + } + } +})) let i18n let store