amis2/packages/amis/__tests__/renderers/Markdown.test.tsx
2022-06-02 10:00:09 +08:00

25 lines
556 B
TypeScript

import React = require('react');
import {render, waitFor} from '@testing-library/react';
import '../../src';
import {render as amisRender} from '../../src';
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();
});