mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-04-02 10:48:51 -03:00
fix(tests): add missing MODEL_TYPES mock in ModelModal tests
Add mock for apiConfig.js MODEL_TYPES constant in test files to fix 'Cannot read properties of undefined' errors when running npm test. - tests/frontend/components/modelMetadata.renamePath.test.js - tests/frontend/components/modelModal.licenseIcons.test.js
This commit is contained in:
@@ -89,6 +89,14 @@ vi.mock(I18N_HELPERS_MODULE, () => ({
|
|||||||
translate: vi.fn((_, __, fallback) => fallback || ''),
|
translate: vi.fn((_, __, fallback) => fallback || ''),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
vi.mock('../../../static/js/api/apiConfig.js', () => ({
|
||||||
|
MODEL_TYPES: {
|
||||||
|
LORA: 'loras',
|
||||||
|
CHECKPOINT: 'checkpoints',
|
||||||
|
EMBEDDING: 'embeddings'
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
vi.mock(API_FACTORY, () => ({
|
vi.mock(API_FACTORY, () => ({
|
||||||
getModelApiClient: vi.fn(),
|
getModelApiClient: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -87,6 +87,14 @@ vi.mock(I18N_HELPERS_MODULE, () => ({
|
|||||||
translate: vi.fn((_, __, fallback) => fallback || ''),
|
translate: vi.fn((_, __, fallback) => fallback || ''),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
vi.mock('../../../static/js/api/apiConfig.js', () => ({
|
||||||
|
MODEL_TYPES: {
|
||||||
|
LORA: 'loras',
|
||||||
|
CHECKPOINT: 'checkpoints',
|
||||||
|
EMBEDDING: 'embeddings'
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
vi.mock(API_FACTORY, () => ({
|
vi.mock(API_FACTORY, () => ({
|
||||||
getModelApiClient: vi.fn(),
|
getModelApiClient: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user