From 2b4d63b1bbbe2e72f06e1763e21f85b6662de8df Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 22 Nov 2018 05:04:45 +0900 Subject: [PATCH] Add some tests --- test/mfm.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/mfm.ts b/test/mfm.ts index 8447e798e..a40f769f8 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -420,6 +420,26 @@ describe('Text', () => { text('after'), ], tokens); }); + + it('with brackets', () => { + const tokens = analyze('[foo](https://example.com/foo(bar))'); + assert.deepEqual([ + nodeWithChildren('link', [ + text('foo') + ], { url: 'https://example.com/foo(bar)', silent: false }) + ], tokens); + }); + + it('with parent brackets', () => { + const tokens = analyze('([foo](https://example.com/foo(bar)))'); + assert.deepEqual([ + text('('), + nodeWithChildren('link', [ + text('foo') + ], { url: 'https://example.com/foo(bar)', silent: false }), + text(')') + ], tokens); + }); }); it('emoji', () => {