/* Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/single 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
John Doe
\n
Birthday: January 1st, 2000
\n
Role: Designer
\n
Location: Brighton
\n
Time zone: Eastern Standard Time
\n \n
Profile details:\n
Profile id: http://example.com/profiles/johndoe
\n
Details are: Public
\n
Last updated: January 1st, 2008 - 13:45
\n
\n
"; var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"given-name":["John"],"sort-string":["John"],"bday":["2000-01-01 00:00:00-08:00"],"role":["Designer"],"geo":[{"value":"30.267991;-97.739568","type":["h-geo"],"properties":{"name":["30.267991;-97.739568"]}}],"tz":["-05:00"],"uid":["http://example.com/profiles/johndoe"],"class":["Public"],"rev":["2008-01-01 13:45:00"]}}],"rels":{},"rel-urls":{}}; it('single', 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); }); });