summaryrefslogtreecommitdiffstats
path: root/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 21:49:04 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 21:49:04 +0200
commit39dac57259cff8b61db0b22cb2ad0a8adb02692e (patch)
tree52a026cc8c22793eb17fd0f5e22adce1ae08a1dd /toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js
parenta1cce3b2b00bbd9f4983013ddd8934a7bccb9e99 (diff)
parentc2d9ab62f3d097c9e0e00184cab1f546554f5eaa (diff)
downloadUXP-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/interface-tests/hasMicroformats-test.js')
-rw-r--r--toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js185
1 files changed, 0 insertions, 185 deletions
diff --git a/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js b/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js
deleted file mode 100644
index 98c79a855..000000000
--- a/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
-Unit test for hasMicroformat
-*/
-
-assert = chai.assert;
-
-
-describe('Microformat.hasMicroformats', function() {
-
- it('true - v2 on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('true - v1 on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="vcard" href="http://glennjones.net"><span class="fn">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('true - v2 filter on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node, {'filters': ['h-card']} ) );
-
- });
-
-
- it('true - v1 filter on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="vcard" href="http://glennjones.net"><span class="fn">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node, {'filters': ['h-card']} ) );
-
- });
-
-
- it('false - v2 filter on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isFalse( Microformats.hasMicroformats( node, {'filters': ['h-entry']} ) );
-
- });
-
-
-
- it('false - property', function(){
-
- var doc,
- node,
- parser;
-
- var html = '<span class="p-name">Glenn</span>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'span' );
-
- assert.isFalse( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('false - no class', function(){
-
- var doc,
- node,
- parser;
-
- var html = '<span>Glenn</span>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'span' );
-
- assert.isFalse( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('false - no node', function(){
- assert.isFalse( Microformats.hasMicroformats( ) );
- });
-
-
- it('false - undefined node', function(){
- assert.isFalse( Microformats.hasMicroformats( undefined ) );
- });
-
-
- it('true - child', function(){
-
- var doc,
- node;
-
- var html = '<section><div><a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a></div></section>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
-
- assert.isTrue( Microformats.hasMicroformats( node ) );
-
- });
-
-
-
- it('true - document', function(){
-
- var doc,
- node;
-
- var html = '<html><head></head><body><section><div><a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a></div></section></body></html>';
-
- var dom = new DOMParser();
- doc = dom.parseFromString( html, 'text/html' );
-
- assert.isTrue( Microformats.hasMicroformats( doc ) );
-
- });
-
-
-
-
-
- });