amis2/packages/amis/__tests__/renderers/Markdown.test.tsx

25 lines
577 B
TypeScript
Raw Normal View History

import React = require('react');
import {render, waitFor} from '@testing-library/react';
import '../../src/themes/default';
import {render as amisRender} from '../../src/index';
import {makeEnv} from '../helper';
test('Renderer:markdown', async () => {
const {container, getByTestId} = render(
amisRender(
{
type: 'markdown',
value: '# title\n markdown **text**'
},
{},
makeEnv({})
)
);
await waitFor(() => {
expect(getByTestId('markdown-body')).toBeInTheDocument();
});
expect(container).toMatchSnapshot();
});