2024-12-25 20:23:12 +08:00
|
|
|
import { buildYaml, flowItemBrief } from '@/yaml';
|
2024-11-25 16:05:01 +08:00
|
|
|
import { describe, expect, test } from 'vitest';
|
|
|
|
|
|
2024-12-25 20:23:12 +08:00
|
|
|
describe('utils', () => {
|
|
|
|
|
test('build yaml', () => {
|
|
|
|
|
const yaml = buildYaml({ url: 'https://www.baidu.com' }, []);
|
|
|
|
|
expect(yaml).toMatchSnapshot();
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-25 16:05:01 +08:00
|
|
|
test('action brief text', () => {
|
|
|
|
|
expect(flowItemBrief({ ai: 'search for weather' })).toMatchSnapshot();
|
|
|
|
|
expect(flowItemBrief({ sleep: 1000 })).toMatchSnapshot();
|
|
|
|
|
expect(
|
|
|
|
|
flowItemBrief({ aiWaitFor: 'wait for something' }),
|
|
|
|
|
).toMatchSnapshot();
|
|
|
|
|
});
|
|
|
|
|
});
|