/* Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review/vcard The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ assert = chai.assert; describe('h-review', function() { var htmlFragment = "
\n 5 out of 5 stars\n

Crepes on Cole is awesome

\n \n Reviewer: Tantek - \n \n \n
\n

\n Crepes on Cole is one of the best little \n creperies in San Francisco.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n

\n
\n

Visit date: April 2005

\n

Food eaten: crepe

\n

Permanent link for review: http://example.com/crepe

\n

Creative Commons Attribution-ShareAlike License

\n
"; var expected = {"items":[{"type":["h-review"],"properties":{"rating":["5"],"name":["Crepes on Cole is awesome"],"reviewer":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"]}}],"reviewed":["2005-04-18"],"description":[{"value":"Crepes on Cole is one of the best little \n creperies in San Francisco.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.","html":"\n

\n Crepes on Cole is one of the best little \n creperies in San Francisco.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n

\n "}],"item":[{"value":"Crepes on Cole","type":["h-card"],"properties":{"name":["Crepes on Cole"],"org":["Crepes on Cole"],"adr":[{"value":"San Francisco","type":["h-adr"],"properties":{"locality":["San Francisco"],"name":["San Francisco"]}}]}}],"category":["crepe"],"url":["http://example.com/crepe"]}}],"rels":{"license":["http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"]},"rel-urls":{"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License":{"text":"Creative Commons Attribution-ShareAlike License","rels":["license"]}}}; it('vcard', 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); }); });