import { mount } from '@vue/test-utils';

import { describe, expect, it } from 'vitest';

import ExecResultItem from '../ExecResultItem.vue';

describe('execResultItem', () => {
  it('preserves line breaks for text results', () => {
    const wrapper = mount(ExecResultItem, {
      props: {
        contentType: 'text',
        defName: 'output',
        result: ['问题：你是谁\n答案：你好'],
        resultCount: 1,
      },
    });

    const textResult = wrapper.get('.whitespace-pre-wrap');
    expect(textResult.text()).toContain('问题：你是谁\n答案：你好');
  });
});
