2025-02-25 07:49:14 +01:00
|
|
|
import { systemPromptToAssert } from '@/ai-model/prompt/assertion';
|
|
|
|
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
|
|
|
|
describe('Assertion prompt', () => {
|
|
|
|
it('return default when it is not UI-Tars', () => {
|
|
|
|
const prompt = systemPromptToAssert({ isUITars: false });
|
2025-02-27 16:44:01 +08:00
|
|
|
expect(prompt).toMatchSnapshot();
|
2025-02-25 07:49:14 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it('return UI-Tars specific when it is UI-Tars', () => {
|
|
|
|
vi.mock('@/ai-model/prompt/ui-tars-planning', () => ({
|
|
|
|
getTimeZoneInfo: vi.fn().mockReturnValue({ isChina: false }),
|
|
|
|
}));
|
|
|
|
|
|
|
|
const prompt = systemPromptToAssert({ isUITars: true });
|
|
|
|
|
2025-02-27 16:44:01 +08:00
|
|
|
expect(prompt).toMatchSnapshot();
|
2025-02-25 07:49:14 +01:00
|
|
|
});
|
|
|
|
});
|