diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 21:49:04 +0200 |
commit | 39dac57259cff8b61db0b22cb2ad0a8adb02692e (patch) | |
tree | 52a026cc8c22793eb17fd0f5e22adce1ae08a1dd /toolkit/components/microformats/test/module-tests/text-test.js | |
parent | a1cce3b2b00bbd9f4983013ddd8934a7bccb9e99 (diff) | |
parent | c2d9ab62f3d097c9e0e00184cab1f546554f5eaa (diff) | |
download | UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.gz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.lz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.xz UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.zip |
Merge branch 'redwood' into 28.9-platform
Diffstat (limited to 'toolkit/components/microformats/test/module-tests/text-test.js')
-rw-r--r-- | toolkit/components/microformats/test/module-tests/text-test.js | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/toolkit/components/microformats/test/module-tests/text-test.js b/toolkit/components/microformats/test/module-tests/text-test.js deleted file mode 100644 index f1f2e775c..000000000 --- a/toolkit/components/microformats/test/module-tests/text-test.js +++ /dev/null @@ -1,56 +0,0 @@ -/* -Unit test for text -*/ - -assert = chai.assert; - -// Tests the private Modules.text object -// Modules.text is unit tested as it has an interface access by other modules - - -describe('Modules.text', function() { - - - it('parse', function(){ - var html = '\n <a href="http://glennjones.net">Glenn\n Jones \n</a> \n', - node = document.createElement('div'); - - node.innerHTML = html; - assert.equal( Modules.text.parse( document, node, 'whitespacetrimmed' ), 'Glenn\n Jones' ); - assert.equal( Modules.text.parse( document, node, 'whitespace' ), '\n Glenn\n Jones \n \n' ); - assert.equal( Modules.text.parse( document, node, 'normalised' ), 'Glenn Jones' ); - - // exclude tags - node.innerHTML = '<script>test</script>text'; - assert.equal( Modules.text.parse( document, node, 'normalised' ), 'text' ); - - // block level - node.innerHTML = '<p>test</p>text'; - //assert.equal( Modules.text.parse( document, node, 'normalised' ), 'test text' ); - - // node with no text data - node = document.createComment('test comment'); - assert.equal( Modules.text.parse( document, node, 'normalised' ), '' ); - - }); - - - it('parseText', function(){ - var text = '\n <a href="http://glennjones.net">Glenn\n Jones \n</a> \n'; - - // create DOM context first - Modules.domUtils.getDOMContext( {} ); - - assert.equal( Modules.text.parseText( document, text, 'whitespacetrimmed' ), 'Glenn\n Jones' ); - assert.equal( Modules.text.parseText( document, text, 'whitespace' ), '\n Glenn\n Jones \n \n' ); - assert.equal( Modules.text.parseText( document, text, 'normalised' ), 'Glenn Jones' ); - }); - - - it('formatText', function(){ - assert.equal( Modules.text.formatText( document, null, 'whitespacetrimmed' ), '' ); - }); - - - -}); |