test: add testcase for markdown table feature

pull/90/head
moonrailgun 2 years ago
parent a16403948e
commit fd4d054753

@ -46,4 +46,15 @@ describe('Markdown', () => {
expect(wrapper.container).toMatchSnapshot();
});
});
test('table', async () => {
const text = `
| A | B |
| --- | --- |
| 1 | 2 |
| 3 | 4 |
`;
const wrapper = await renderLazy(<Markdown raw={text} />);
expect(wrapper.container).toMatchSnapshot();
});
});

@ -218,3 +218,42 @@ exports[`Markdown list 1`] = `
</div>
</div>
`;
exports[`Markdown table 1`] = `
<div>
<div
class="tailchat-markdown"
>
<table>
<thead>
<tr>
<th>
A
</th>
<th>
B
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
1
</td>
<td>
2
</td>
</tr>
<tr>
<td>
3
</td>
<td>
4
</td>
</tr>
</tbody>
</table>
</div>
</div>
`;

Loading…
Cancel
Save