mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-25 07:25:13 +00:00
Add PlainParser tests
This commit is contained in:
parent
87cb008c26
commit
294e7a5574
1 changed files with 20 additions and 0 deletions
|
@ -24,6 +24,26 @@ describe('PlainParser', () => {
|
|||
assert.deepStrictEqual(mfm.parsePlain(input), output);
|
||||
});
|
||||
});
|
||||
|
||||
describe('emoji', () => {
|
||||
it('basic', () => {
|
||||
const input = ':foo:';
|
||||
const output = [EMOJI_CODE('foo')];
|
||||
assert.deepStrictEqual(mfm.parsePlain(input), output);
|
||||
});
|
||||
|
||||
it('between texts', () => {
|
||||
const input = 'foo:bar:baz';
|
||||
const output = [TEXT('foo'), EMOJI_CODE('bar'), TEXT('baz')];
|
||||
assert.deepStrictEqual(mfm.parsePlain(input), output);
|
||||
});
|
||||
});
|
||||
|
||||
it('disallow other syntaxes', () => {
|
||||
const input = 'foo **bar** baz';
|
||||
const output = [TEXT('foo **bar** baz')];
|
||||
assert.deepStrictEqual(mfm.parsePlain(input), output);
|
||||
});
|
||||
});
|
||||
|
||||
describe('FullParser', () => {
|
||||
|
|
Loading…
Reference in a new issue