mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-10-12 02:01:26 +00:00
fix tests
This commit is contained in:
@@ -9,7 +9,8 @@ vi.mock('panel/api/generated', () => ({
|
||||
}));
|
||||
|
||||
vi.mock('panel/stores/toasts', () => ({ addErrorToast: vi.fn() }));
|
||||
vi.mock('panel/helpers/constants', () => ({
|
||||
vi.mock('panel/helpers/constants', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import('panel/helpers/constants')>()),
|
||||
ALL_INTERFACES_IP: '0.0.0.0',
|
||||
INSTALL_FIRST_STEP: 1,
|
||||
STANDARD_DNS_PORT: 53,
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { translate } from '@adguard/translate';
|
||||
import { LocalStorageHelper } from '../helpers/localStorageHelper';
|
||||
|
||||
// Ensure the real constants module is available even when other test files
|
||||
// (e.g., install-store.test.ts) mock it with a partial stub.
|
||||
vi.mock('panel/helpers/constants', async (importOriginal) =>
|
||||
importOriginal<typeof import('panel/helpers/constants')>(),
|
||||
);
|
||||
|
||||
import {
|
||||
createSolidDefaultValues,
|
||||
solidMessageConstructor,
|
||||
|
||||
@@ -11,8 +11,10 @@ vi.mock('panel/stores/toasts', () => ({
|
||||
addErrorToast: vi.fn(),
|
||||
}));
|
||||
|
||||
// Mock HTML_PAGES constant.
|
||||
vi.mock('panel/helpers/constants', () => ({
|
||||
// Mock HTML_PAGES constant, but pass through all real exports so
|
||||
// transitive dependencies (e.g., LANGUAGE_QUERY_PARAM in intl) work.
|
||||
vi.mock('panel/helpers/constants', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import('panel/helpers/constants')>()),
|
||||
HTML_PAGES: { LOGIN: '/login.html', MAIN: '/dashboard.html' },
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user