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-02-10 20:15:39 +08:00
|
|
|
import '../../src/themes/default';
|
|
|
|
import {render as amisRender} from '../../src/index';
|
|
|
|
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();
|
|
|
|
});
|