/*
Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
Mocha integration test from: microformats-v1/hcard/multiple
The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
*/
assert = chai.assert;
describe('hcard', function() {
var htmlFragment = "\n
\n \n
John Doe
\n
Pronunciation of my name\n
\n\n
Nicknames:
\n
\n - Man with no name
\n - Lost boy
\n
\n\n
About:
\n
John Doe is one of those names you always have issues with.
\n
It can be a real problem booking a hotel room with the name John Doe.
\n\n
Companies:
\n
\n
\n
\n
\n
\n \n
Tags: \n design, \n development and\n web\n
\n \n
Phone numbers:
\n
\n - \n Work (preferred):\n +1 415 555 100\n
\n - Home: +1 415 555 200
\n - Postal: +1 415 555 300
\n
\n \n
Emails:
\n
\n
John Doe uses PigeonMail 2.1 or Outlook 2007 for email.
\n\n
Addresses:
\n
\n - \n \n Work: \n North Street, \n Brighton, \n United Kingdom\n \n \n
\n - \n \n Home: \n West Street, \n Brighton, \n United Kingdom\n \n
\n
\n \n
In emergency contact: Jane Doe or Dave Doe.
\n
Key: hd02$Gfu*d%dh87KTa2=23934532479
\n
";
var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"given-name":["John"],"family-name":["Doe"],"sound":["http://www.madgex.com/johndoe.mpeg"],"photo":["http://example.com/images/photo.gif"],"nickname":["Man with no name","Lost boy"],"note":["John Doe is one of those names you always have issues with.","It can be a real problem booking a hotel room with the name John Doe."],"logo":["http://example.com/images/logo.gif","http://example.com/images/logo.gif"],"url":["http://www.madgex.com/","http://www.webfeetmedia.com/"],"org":["Madgex","Web Feet Media Ltd"],"job-title":["Creative Director","Owner"],"category":["design","development","web"],"tel":["+1 415 555 100","+1 415 555 200","+1 415 555 300"],"email":["mailto:john.doe@madgex.com","mailto:john.doe@webfeetmedia.com"],"mailer":["PigeonMail 2.1","Outlook 2007"],"label":["Work: \n North Street, \n Brighton, \n United Kingdom","Home: \n West Street, \n Brighton, \n United Kingdom"],"adr":[{"value":"Work: \n North Street, \n Brighton, \n United Kingdom","type":["h-adr"],"properties":{"street-address":["North Street"],"locality":["Brighton"],"country-name":["United Kingdom"]}},{"value":"Home: \n West Street, \n Brighton, \n United Kingdom","type":["h-adr"],"properties":{"street-address":["West Street"],"locality":["Brighton"],"country-name":["United Kingdom"]}}],"agent":["Jane Doe",{"value":"Dave Doe","type":["h-card"],"properties":{"name":["Dave Doe"]}}],"key":["hd02$Gfu*d%dh87KTa2=23934532479"]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/design","http://en.wikipedia.org/wiki/development","http://en.wikipedia.org/wiki/web"]},"rel-urls":{"http://en.wikipedia.org/wiki/design":{"text":"design","rels":["tag"]},"http://en.wikipedia.org/wiki/development":{"text":"development","rels":["tag"]},"http://en.wikipedia.org/wiki/web":{"text":"web","rels":["tag"]}}};
it('multiple', function(){
var doc, dom, node, options, parser, found;
dom = new DOMParser();
doc = dom.parseFromString( htmlFragment, 'text/html' );
options ={
'document': doc,
'node': doc,
'baseUrl': 'http://example.com',
'dateFormat': 'html5'
};
found = Microformats.get( options );
assert.deepEqual(found, expected);
});
});