[Test] Add MFM test

This commit is contained in:
syuilo 2019-01-31 14:31:25 +09:00
parent fdcc994291
commit e4c745bccd
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
1 changed files with 16 additions and 0 deletions

View File

@ -277,6 +277,22 @@ describe('MFM', () => {
]); ]);
}); });
it('multi', () => {
const tokens = parse('<spin>:foo:</spin><spin>:foo:</spin>');
assert.deepStrictEqual(tokens, [
tree('spin', [
leaf('emoji', { name: 'foo' })
], {
attr: 'left'
}),
tree('spin', [
leaf('emoji', { name: 'foo' })
], {
attr: 'left'
}),
]);
});
it('nested', () => { it('nested', () => {
const tokens = parse('<spin><spin>:foo:</spin></spin>'); const tokens = parse('<spin><spin>:foo:</spin></spin>');
assert.deepStrictEqual(tokens, [ assert.deepStrictEqual(tokens, [