feat: 优化内容模板变量引用与换行展示
- 内容模板直接引用上游参数并自动维护运行参数 - 支持 Enjoy 变量标签编辑及中文变量显示 - 保留试运行与聊天运行页的模板输出换行
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {mount} from '@vue/test-utils';
|
||||
import {nextTick} from 'vue';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { nextTick } from 'vue';
|
||||
|
||||
import {describe, expect, it, vi} from 'vitest';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import ChatTimeMarkdown from '../ChatTimeMarkdown.vue';
|
||||
|
||||
@@ -11,7 +11,21 @@ vi.mock('@easyflow-core/preferences', () => ({
|
||||
}),
|
||||
}));
|
||||
|
||||
describe('ChatTimeMarkdown', () => {
|
||||
describe('chatTimeMarkdown', () => {
|
||||
it('renders a single source line break as a visible line break', async () => {
|
||||
const wrapper = mount(ChatTimeMarkdown, {
|
||||
props: {
|
||||
content: '问题:你是谁\n答案:你好',
|
||||
},
|
||||
});
|
||||
|
||||
await nextTick();
|
||||
|
||||
expect(wrapper.text()).toContain('问题:你是谁');
|
||||
expect(wrapper.text()).toContain('答案:你好');
|
||||
expect(wrapper.find('br').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('renders mermaid code fences with the shared mermaid block', async () => {
|
||||
const wrapper = mount(ChatTimeMarkdown, {
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user