2022-02-10 20:15:39 +08:00
|
|
|
import React = require('react');
|
2022-04-12 14:22:39 +08:00
|
|
|
import {render, waitFor} from '@testing-library/react';
|
|
|
|
|
2022-06-02 10:00:09 +08:00
|
|
|
import '../../src';
|
|
|
|
import {render as amisRender} from '../../src';
|
2022-02-10 20:15:39 +08:00
|
|
|
import {makeEnv} from '../helper';
|
|
|
|
|
2022-04-12 14:22:39 +08:00
|
|
|
test('Renderer:markdown', async () => {
|
|
|
|
const {container, getByTestId} = render(
|
2022-02-10 20:15:39 +08:00
|
|
|
amisRender(
|
|
|
|
{
|
|
|
|
type: 'markdown',
|
|
|
|
value: '# title\n markdown **text**'
|
|
|
|
},
|
|
|
|
{},
|
|
|
|
makeEnv({})
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2022-04-12 14:22:39 +08:00
|
|
|
await waitFor(() => {
|
|
|
|
expect(getByTestId('markdown-body')).toBeInTheDocument();
|
|
|
|
});
|
2022-02-10 20:15:39 +08:00
|
|
|
expect(container).toMatchSnapshot();
|
|
|
|
});
|