mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-07 00:46:44 -03:00
22 lines
749 B
JavaScript
22 lines
749 B
JavaScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { ModelContextMenuMixin } from '../../../static/js/components/ContextMenu/ModelContextMenuMixin.js';
|
|
|
|
describe('ModelContextMenuMixin.extractModelVersionId', () => {
|
|
it('accepts civitai.red model URLs', () => {
|
|
expect(
|
|
ModelContextMenuMixin.extractModelVersionId(
|
|
'https://civitai.red/models/65423/nijimecha-artstyle?modelVersionId=777'
|
|
)
|
|
).toEqual({ modelId: '65423', modelVersionId: '777' });
|
|
});
|
|
|
|
it('rejects model-like URLs from unsupported hosts', () => {
|
|
expect(
|
|
ModelContextMenuMixin.extractModelVersionId(
|
|
'https://example.com/models/65423?modelVersionId=777'
|
|
)
|
|
).toEqual({ modelId: null, modelVersionId: null });
|
|
});
|
|
});
|