diff options
author | ache <ache@ache.one> | 2018-05-27 11:07:07 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2018-05-27 11:07:07 +0200 |
commit | 767f2cb208c2f37376db08cd554456de186a4440 (patch) | |
tree | 23cbab3d293dbadda85c548b51d9e09fe37f691a /__tests__/index.js | |
parent | Test revision with parse5 (diff) |
Add more tests again
Diffstat (limited to '__tests__/index.js')
-rw-r--r-- | __tests__/index.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/__tests__/index.js b/__tests__/index.js index 239e1aa..199b8e4 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -127,3 +127,24 @@ test('extended-global', t => { t.deepEqual(parse(contents), parse(`<p> <em>Wait</em> ! You are <strong ex-attr="true">beautiful</strong> !</p>`)); }); +test('extended-invalid-scope', t => { + const renderExtended = generateExtendParser({scope: 'invalid', extend: {strong: ['exAttr']}}); + const invalidString = `*Wait* ! You are **beautiful**{ exAttr="true" onload="qdss" pss="NOK" } !`; + const {contents} = renderExtended(invalidString); + t.deepEqual(parse(contents), parse(`<p><em>Wait</em> ! You are <strong ex-attr="true">beautiful</strong> !</p>`)); +}); + +test('invalid-scope', t => { + const renderExtended = generateExtendParser({extend: 'exAttr'}); + const invalidString = ` *Wait* ! I **love**{ exAttr="true" onload="qdss" pss="NOK" } you !`; + const {contents} = renderExtended(invalidString); + t.deepEqual(parse(contents), parse(`<p> <em>Wait</em> ! I <strong>love</strong> you !</p>`)); +}); + +test('invalid-extend', t => { + const renderExtended = generateExtendParser({extend: 'exAttr'}); + const invalidString = ` *Wait* ! I **love**{ exAttr="true" onload="qdss" attr="NOK" style="color: red;"} you!`; + const {contents} = renderExtended(invalidString); + t.deepEqual(parse(contents), parse(`<p> <em>Wait</em> ! I <strong style="color: red;">love</strong> you!</p>`)); +}); + |