From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../microformats/test/standards-tests/index.html | 179 +++++++++++++++++++++ .../mf-mixed-h-card-mixedpropertries.js | 27 ++++ .../standards-tests/mf-mixed-h-card-tworoots.js | 27 ++++ .../standards-tests/mf-mixed-h-entry-mixedroots.js | 27 ++++ .../mf-mixed-h-resume-mixedroots.js | 27 ++++ .../standards-tests/mf-v1-adr-simpleproperties.js | 27 ++++ .../test/standards-tests/mf-v1-geo-abbrpattern.js | 27 ++++ .../test/standards-tests/mf-v1-geo-hidden.js | 27 ++++ .../standards-tests/mf-v1-geo-simpleproperties.js | 27 ++++ .../standards-tests/mf-v1-geo-valuetitleclass.js | 27 ++++ .../test/standards-tests/mf-v1-hcalendar-ampm.js | 27 ++++ .../standards-tests/mf-v1-hcalendar-attendees.js | 27 ++++ .../standards-tests/mf-v1-hcalendar-combining.js | 27 ++++ .../standards-tests/mf-v1-hcalendar-concatenate.js | 27 ++++ .../test/standards-tests/mf-v1-hcalendar-time.js | 27 ++++ .../test/standards-tests/mf-v1-hcard-email.js | 27 ++++ .../test/standards-tests/mf-v1-hcard-format.js | 27 ++++ .../mf-v1-hcard-hyperlinkedphoto.js | 27 ++++ .../standards-tests/mf-v1-hcard-justahyperlink.js | 27 ++++ .../test/standards-tests/mf-v1-hcard-justaname.js | 27 ++++ .../test/standards-tests/mf-v1-hcard-multiple.js | 27 ++++ .../test/standards-tests/mf-v1-hcard-name.js | 27 ++++ .../test/standards-tests/mf-v1-hcard-single.js | 27 ++++ .../standards-tests/mf-v1-hentry-summarycontent.js | 27 ++++ .../test/standards-tests/mf-v1-hfeed-simple.js | 27 ++++ .../test/standards-tests/mf-v1-hnews-all.js | 27 ++++ .../test/standards-tests/mf-v1-hnews-minimum.js | 27 ++++ .../standards-tests/mf-v1-hproduct-aggregate.js | 27 ++++ .../mf-v1-hproduct-simpleproperties.js | 27 ++++ .../standards-tests/mf-v1-hresume-affiliation.js | 27 ++++ .../test/standards-tests/mf-v1-hresume-contact.js | 27 ++++ .../standards-tests/mf-v1-hresume-education.js | 27 ++++ .../test/standards-tests/mf-v1-hresume-skill.js | 27 ++++ .../test/standards-tests/mf-v1-hresume-work.js | 27 ++++ .../mf-v1-hreview-aggregate-hcard.js | 27 ++++ .../mf-v1-hreview-aggregate-justahyperlink.js | 27 ++++ .../mf-v1-hreview-aggregate-vevent.js | 27 ++++ .../test/standards-tests/mf-v1-hreview-item.js | 27 ++++ .../test/standards-tests/mf-v1-hreview-vcard.js | 27 ++++ .../standards-tests/mf-v1-includes-hcarditemref.js | 27 ++++ .../mf-v1-includes-heventitemref.js | 27 ++++ .../standards-tests/mf-v1-includes-hyperlink.js | 27 ++++ .../test/standards-tests/mf-v1-includes-object.js | 27 ++++ .../test/standards-tests/mf-v1-includes-table.js | 27 ++++ .../test/standards-tests/mf-v2-h-adr-geo.js | 27 ++++ .../test/standards-tests/mf-v2-h-adr-geourl.js | 27 ++++ .../test/standards-tests/mf-v2-h-adr-justaname.js | 27 ++++ .../mf-v2-h-adr-simpleproperties.js | 27 ++++ .../test/standards-tests/mf-v2-h-as-note-note.js | 27 ++++ .../test/standards-tests/mf-v2-h-card-baseurl.js | 27 ++++ .../standards-tests/mf-v2-h-card-childimplied.js | 27 ++++ .../mf-v2-h-card-extendeddescription.js | 27 ++++ .../test/standards-tests/mf-v2-h-card-hcard.js | 27 ++++ .../test/standards-tests/mf-v2-h-card-horghcard.js | 27 ++++ .../mf-v2-h-card-hyperlinkedphoto.js | 27 ++++ .../standards-tests/mf-v2-h-card-impliedname.js | 27 ++++ .../standards-tests/mf-v2-h-card-impliedphoto.js | 27 ++++ .../standards-tests/mf-v2-h-card-impliedurl.js | 27 ++++ .../standards-tests/mf-v2-h-card-justahyperlink.js | 27 ++++ .../test/standards-tests/mf-v2-h-card-justaname.js | 27 ++++ .../test/standards-tests/mf-v2-h-card-nested.js | 27 ++++ .../standards-tests/mf-v2-h-card-p-property.js | 27 ++++ .../standards-tests/mf-v2-h-card-relativeurls.js | 27 ++++ .../mf-v2-h-entry-impliedvalue-nested.js | 27 ++++ .../mf-v2-h-entry-justahyperlink.js | 27 ++++ .../standards-tests/mf-v2-h-entry-justaname.js | 27 ++++ .../mf-v2-h-entry-summarycontent.js | 27 ++++ .../standards-tests/mf-v2-h-entry-u-property.js | 27 ++++ .../standards-tests/mf-v2-h-entry-urlincontent.js | 27 ++++ .../test/standards-tests/mf-v2-h-event-ampm.js | 27 ++++ .../standards-tests/mf-v2-h-event-attendees.js | 27 ++++ .../standards-tests/mf-v2-h-event-combining.js | 27 ++++ .../standards-tests/mf-v2-h-event-concatenate.js | 27 ++++ .../test/standards-tests/mf-v2-h-event-dates.js | 27 ++++ .../standards-tests/mf-v2-h-event-dt-property.js | 27 ++++ .../mf-v2-h-event-justahyperlink.js | 27 ++++ .../standards-tests/mf-v2-h-event-justaname.js | 27 ++++ .../test/standards-tests/mf-v2-h-event-time.js | 27 ++++ .../standards-tests/mf-v2-h-feed-implied-title.js | 27 ++++ .../test/standards-tests/mf-v2-h-feed-simple.js | 27 ++++ .../standards-tests/mf-v2-h-geo-abbrpattern.js | 27 ++++ .../test/standards-tests/mf-v2-h-geo-altitude.js | 27 ++++ .../test/standards-tests/mf-v2-h-geo-hidden.js | 27 ++++ .../test/standards-tests/mf-v2-h-geo-justaname.js | 27 ++++ .../mf-v2-h-geo-simpleproperties.js | 27 ++++ .../standards-tests/mf-v2-h-geo-valuetitleclass.js | 27 ++++ .../test/standards-tests/mf-v2-h-news-all.js | 27 ++++ .../test/standards-tests/mf-v2-h-news-minimum.js | 27 ++++ .../test/standards-tests/mf-v2-h-org-hyperlink.js | 27 ++++ .../test/standards-tests/mf-v2-h-org-simple.js | 27 ++++ .../mf-v2-h-org-simpleproperties.js | 27 ++++ .../standards-tests/mf-v2-h-product-aggregate.js | 27 ++++ .../mf-v2-h-product-justahyperlink.js | 27 ++++ .../standards-tests/mf-v2-h-product-justaname.js | 27 ++++ .../mf-v2-h-product-simpleproperties.js | 27 ++++ .../test/standards-tests/mf-v2-h-recipe-all.js | 27 ++++ .../test/standards-tests/mf-v2-h-recipe-minimum.js | 27 ++++ .../standards-tests/mf-v2-h-resume-affiliation.js | 27 ++++ .../test/standards-tests/mf-v2-h-resume-contact.js | 27 ++++ .../standards-tests/mf-v2-h-resume-education.js | 27 ++++ .../standards-tests/mf-v2-h-resume-justaname.js | 27 ++++ .../test/standards-tests/mf-v2-h-resume-skill.js | 27 ++++ .../test/standards-tests/mf-v2-h-resume-work.js | 27 ++++ .../mf-v2-h-review-aggregate-hevent.js | 27 ++++ .../mf-v2-h-review-aggregate-justahyperlink.js | 27 ++++ .../mf-v2-h-review-aggregate-simpleproperties.js | 27 ++++ .../standards-tests/mf-v2-h-review-hyperlink.js | 27 ++++ .../standards-tests/mf-v2-h-review-implieditem.js | 27 ++++ .../test/standards-tests/mf-v2-h-review-item.js | 27 ++++ .../standards-tests/mf-v2-h-review-justaname.js | 27 ++++ .../test/standards-tests/mf-v2-h-review-photo.js | 27 ++++ .../test/standards-tests/mf-v2-h-review-vcard.js | 27 ++++ .../standards-tests/mf-v2-rel-duplicate-rels.js | 27 ++++ .../test/standards-tests/mf-v2-rel-license.js | 27 ++++ .../test/standards-tests/mf-v2-rel-nofollow.js | 27 ++++ .../test/standards-tests/mf-v2-rel-rel-urls.js | 27 ++++ .../mf-v2-rel-varying-text-duplicate-rels.js | 27 ++++ .../test/standards-tests/mf-v2-rel-xfn-all.js | 27 ++++ .../standards-tests/mf-v2-rel-xfn-elsewhere.js | 27 ++++ 119 files changed, 3365 insertions(+) create mode 100644 toolkit/components/microformats/test/standards-tests/index.html create mode 100644 toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js (limited to 'toolkit/components/microformats/test/standards-tests') diff --git a/toolkit/components/microformats/test/standards-tests/index.html b/toolkit/components/microformats/test/standards-tests/index.html new file mode 100644 index 000000000..47f89f988 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/index.html @@ -0,0 +1,179 @@ +Mocha + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Microformats-shiv: standards tests

+

Standards tests built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST). Downloaded from github repo: microformats/tests version v0.1.24

+
+ + + diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js new file mode 100644 index 000000000..db99dc92a --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-mixed/h-card/mixedpropertries +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "
\n

\n Mozilla Foundation\n \n

\n

\n 665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A. \n

\n
"; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mozilla Foundation"],"org":["Mozilla Foundation"],"url":["http://mozilla.org/"],"adr":[{"value":"665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A.","type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"]}}]}}],"rels":{},"rel-urls":{}}; + + it('mixedpropertries', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js new file mode 100644 index 000000000..be43abcd8 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-mixed/h-card/tworoots +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "

Frances Berriman

"; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Frances Berriman"]}}],"rels":{},"rel-urls":{}}; + + it('tworoots', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js new file mode 100644 index 000000000..705ffeebf --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-mixed/h-entry/mixedroots +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-entry', function() { + var htmlFragment = "\n\n\n
\n \n
Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\n
\n
"; + var expected = {"items":[{"type":["h-entry"],"properties":{"author":[{"value":"aaronparecki.com\n Aaron Parecki\n Aaron Parecki","type":["h-card"],"properties":{"photo":["https://aaronparecki.com/images/aaronpk.png"],"logo":["https://aaronparecki.com/images/aaronpk.png"],"url":["https://aaronparecki.com/"],"uid":["https://aaronparecki.com/"],"name":["Aaron Parecki"]}}],"content":[{"value":"Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/","html":"Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\n "}],"name":["Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/"],"category":["realtimeconf"]}}],"rels":{"author":["https://aaronparecki.com/","https://plus.google.com/117847912875913905493"]},"rel-urls":{"https://aaronparecki.com/":{"text":"aaronparecki.com","rels":["author"]},"https://plus.google.com/117847912875913905493":{"text":"Aaron Parecki","rels":["author"]}}}; + + it('mixedroots', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js new file mode 100644 index 000000000..5147866c6 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-mixed/h-resume/mixedroots +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-resume', function() { + var htmlFragment = "\n
\n
\n

Tim Berners-Lee

\n

Director of the World Wide Web Foundation

\n
\n

Invented the World Wide Web.


\n
\n

Director

\n

World Wide Web Foundation

\n

\n – Present\n \n

\n
\n
"; + var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"job-title":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"experience":[{"value":"World Wide Web Foundation","type":["h-event","h-card"],"properties":{"job-title":["Director"],"name":["World Wide Web Foundation"],"org":["World Wide Web Foundation"],"url":["http://www.webfoundation.org/"],"start":["2009-01-18"],"duration":["P2Y11M"]}}],"name":["Tim Berners-Lee\n Director of the World Wide Web Foundation\n \n Invented the World Wide Web.\n \n Director\n World Wide Web Foundation\n \n Jan 2009 – Present\n (2 years 11 month)"]}}],"rels":{},"rel-urls":{}}; + + it('mixedroots', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js new file mode 100644 index 000000000..09a346e0c --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/adr/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('adr', function() { + var htmlFragment = "

\n 665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A. \n

"; + var expected = {"items":[{"type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}],"rels":{},"rel-urls":{}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js new file mode 100644 index 000000000..090e98bb9 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/geo/abbrpattern +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('geo', function() { + var htmlFragment = "\n

\n N 37° 24.491, \n W 122° 08.313\n

"; + var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["37.408183"],"longitude":["-122.13855"]}}],"rels":{},"rel-urls":{}}; + + it('abbrpattern', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js new file mode 100644 index 000000000..d67a03b4f --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/geo/hidden +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('geo', function() { + var htmlFragment = "

\n The Bricklayer's Arms\n \n \n \n \n \n \n \n

"; + var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}}; + + it('hidden', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js new file mode 100644 index 000000000..82cd7d3d9 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/geo/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('geo', function() { + var htmlFragment = "We are meeting at \n \n The Bricklayer's Arms\n (Geo: 51.513458:\n -0.14812)\n"; + var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js new file mode 100644 index 000000000..196e07f7d --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/geo/valuetitleclass +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('geo', function() { + var htmlFragment = "\n

\n \n \n N 51° 51.345, \n \n \n W -0° 14.812\n \n \n

"; + var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}}; + + it('valuetitleclass', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js new file mode 100644 index 000000000..5da5fd7df --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcalendar/ampm +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcalendar', function() { + var htmlFragment = "
\n The 4th Microformat party will be on \n \n
"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00","2009-06-26 07:00:00","2009-06-26 19:00","2009-06-26 19","2009-06-26 19","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 07:00"]}}],"rels":{},"rel-urls":{}}; + + it('ampm', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js new file mode 100644 index 000000000..ca28ad431 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcalendar/attendees +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcalendar', function() { + var htmlFragment = "\n
\n CPJ Online Press Freedom Summit\n () in\n San Francisco.\n Attendees:\n \n
\n"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["CPJ Online Press Freedom Summit"],"start":["2012-10-10"],"location":["San Francisco"],"attendee":[{"value":"Brian Warner","type":["h-card"],"properties":{"name":["Brian Warner"]}},{"value":"Kyle Machulis","type":["h-card"],"properties":{"name":["Kyle Machulis"]}},{"value":"Tantek Çelik","type":["h-card"],"properties":{"name":["Tantek Çelik"]}},{"value":"Sid Sutter","type":["h-card"],"properties":{"name":["Sid Sutter"]}}]}}],"rels":{},"rel-urls":{}}; + + it('attendees', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js new file mode 100644 index 000000000..7e5a361b1 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcalendar/combining +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcalendar', function() { + var htmlFragment = "
\n \n IndieWebCamp 2012\n \n from \n to at \n \n Geoloqi, \n \n 920 SW 3rd Ave. Suite 400, \n Portland, \n OR\n \n \n
"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"],"url":["http://indiewebcamp.com/2012"],"start":["2012-06-30"],"end":["2012-07-01"],"location":[{"value":"Geoloqi","type":["h-card"],"properties":{"name":["Geoloqi"],"org":["Geoloqi"],"url":["http://geoloqi.com/"],"adr":[{"value":"920 SW 3rd Ave. Suite 400, \n Portland, \n OR","type":["h-adr"],"properties":{"street-address":["920 SW 3rd Ave. Suite 400"],"locality":["Portland"],"region":["Oregon"]}}]}}]}}],"rels":{},"rel-urls":{}}; + + it('combining', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js new file mode 100644 index 000000000..d17914e1c --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcalendar/concatenate +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcalendar', function() { + var htmlFragment = "
\n The 4th Microformat party will be on \n \n , from\n to \n .\n
"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00"],"end":["2009-06-26 22:00"]}}],"rels":{},"rel-urls":{}}; + + it('concatenate', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js new file mode 100644 index 000000000..edb26d6ad --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcalendar/time +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcalendar', function() { + var htmlFragment = "
\n The 4th Microformat party will be on \n \n
"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00-08:00","2009-06-26 19:00:00-08:00","2009-06-26 19:00:00+08:00","2009-06-26 19:00:00Z","2009-06-26 19:00:00","2009-06-26 19:00-08:00","2009-06-26 19:00+08:00","2009-06-26 19:00Z","2009-06-26 19:00"],"end":["2013-034"]}}],"rels":{},"rel-urls":{}}; + + it('time', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js new file mode 100644 index 000000000..48660ffb1 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcard/email +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcard', function() { + var htmlFragment = "
\n John Doe \n \n
"; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"email":["mailto:john@example.com","mailto:john@example.com","mailto:john@example.com?subject=parser-test","john@example.com"]}}],"rels":{},"rel-urls":{}}; + + it('email', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js new file mode 100644 index 000000000..eb539fd87 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcard/format +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 \n Doe \n \n

"; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["John \n Doe"],"given-name":["John"]}}],"rels":{},"rel-urls":{}}; + + it('format', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js new file mode 100644 index 000000000..7f348b4a8 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcard/hyperlinkedphoto +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcard', function() { + var htmlFragment = "\n \"Rohit\n"; + var expected = {"items":[{"type":["h-card"],"properties":{}}],"rels":{},"rel-urls":{}}; + + it('hyperlinkedphoto', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js new file mode 100644 index 000000000..e320f0f8a --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcard/justahyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcard', function() { + var htmlFragment = "Ben Ward"; + var expected = {"items":[{"type":["h-card"],"properties":{}}],"rels":{},"rel-urls":{}}; + + it('justahyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js new file mode 100644 index 000000000..ba2a6d47d --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcard/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hcard', function() { + var htmlFragment = "

Frances Berriman

"; + var expected = {"items":[{"type":["h-card"],"properties":{}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js new file mode 100644 index 000000000..058e5e2ae --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js @@ -0,0 +1,27 @@ +/* +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
\"Photo
\n\n

Nicknames:

\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 \"Madgex\n \"Web\n
\n \n \n

Tags: \n design, \n development and\n web\n

\n \n

Phone numbers:

\n \n \n

Emails:

\n \n

John Doe uses PigeonMail 2.1 or Outlook 2007 for email.

\n\n

Addresses:

\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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js new file mode 100644 index 000000000..ef75899cf --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hcard/name +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 Dr \n John \n P \n Doe \n \n \"PHD\"\n
\n
"; + var expected = {"items":[{"type":["h-card"],"properties":{"honorific-prefix":["Dr"],"given-name":["John"],"additional-name":["Peter"],"family-name":["Doe"],"honorific-suffix":["MSc","PHD"],"photo":["http://example.com/images/logo.gif"]}}],"rels":{},"rel-urls":{}}; + + it('name', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js new file mode 100644 index 000000000..a7ef7628b --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js @@ -0,0 +1,27 @@ +/* +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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js new file mode 100644 index 000000000..5280efb04 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hentry/summarycontent +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hentry', function() { + var htmlFragment = "\n
\n

microformats.org at 7

\n
\n

Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

\n\n

The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

\n
\n

Updated \n by\n Tantek\n

\n
"; + var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n

Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

\n\n

The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"rels":{},"rel-urls":{}}; + + it('summarycontent', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js new file mode 100644 index 000000000..4c8294d49 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hfeed/simple +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hfeed', function() { + var htmlFragment = "
\n\t

Microformats blog

\n\tTantek\n\tpermlink\n\t\n\t

\n\t\tTags: microformats, \n\t\thtml\n\t

\n\t\n\t
\n\t

microformats.org at 7

\n\t
\n\t

Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.

\n\t\n\t

The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service

\n\t
\n\t

Updated \n\t \n\t

\n\t
\n\t\n
"; + var expected = {"items":[{"type":["h-feed"],"properties":{"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}],"url":["http://microformats.org/blog"],"photo":["http://example.com/photo.jpeg"],"category":["microformats","html"]},"children":[{"value":"microformats.org at 7\n\t \n\t Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service \n\t \n\t Updated \n\t June 25th, 2012","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service","html":"\n\t

Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.

\n\t\n\t

The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service

\n\t "}],"summary":["Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities."],"updated":["2012-06-25 17:08:26"]}}]}],"rels":{"tag":["http://example.com/tags/microformats","http://example.com/tags/html"],"bookmark":["http://microformats.org/2012/06/25/microformats-org-at-7"]},"rel-urls":{"http://example.com/tags/microformats":{"text":"microformats","rels":["tag"]},"http://example.com/tags/html":{"text":"html","rels":["tag"]},"http://microformats.org/2012/06/25/microformats-org-at-7":{"text":"microformats.org at 7","rels":["bookmark"]}}}; + + it('simple', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js new file mode 100644 index 000000000..82eb37b95 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hnews/all +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hnews', function() { + var htmlFragment = "
\n
\n

microformats.org at 7

\n
\n

Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

\n\n

The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

\n
\n

Updated \n by\n Tantek\n

\n
\n\n

\n \n \n San Francisco, \n CA \n \n \n (Geo: 37.774921;-122.445202) \n \n microformats.org\n \n

\n

\n Publishing policy\n

\n
"; + var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n

Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

\n\n

The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"dateline":[{"value":"San Francisco, \n CA","type":["h-card"],"properties":{"adr":[{"value":"San Francisco, \n CA","type":["h-adr"],"properties":{"locality":["San Francisco"],"region":["CA"]}}]}}],"geo":[{"value":"37.774921;-122.445202","type":["h-geo"],"properties":{"name":["37.774921;-122.445202"]}}],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"org":["microformats.org"],"url":["http://microformats.org/"]}}],"principles":["http://microformats.org/wiki/Category:public_domain_license"]}}],"rels":{"bookmark":["http://microformats.org/2012/06/25/microformats-org-at-7"],"principles":["http://microformats.org/wiki/Category:public_domain_license"]},"rel-urls":{"http://microformats.org/2012/06/25/microformats-org-at-7":{"text":"microformats.org at 7","rels":["bookmark"]},"http://microformats.org/wiki/Category:public_domain_license":{"text":"Publishing policy","rels":["principles"]}}}; + + it('all', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js new file mode 100644 index 000000000..5faf13d7b --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hnews/minimum +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hnews', function() { + var htmlFragment = "
\n
\n

microformats.org at 7

\n
\n

Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

\n\n

The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

\n
\n

Updated \n by\n Tantek\n

\n
\n\n

\n microformats.org \n

\n
"; + var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n

Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

\n\n

The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"org":["microformats.org"],"url":["http://microformats.org/"]}}]}}],"rels":{"bookmark":["http://microformats.org/2012/06/25/microformats-org-at-7"]},"rel-urls":{"http://microformats.org/2012/06/25/microformats-org-at-7":{"text":"microformats.org at 7","rels":["bookmark"]}}}; + + it('minimum', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js new file mode 100644 index 000000000..7171bc726 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hproduct/aggregate +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hproduct', function() { + var htmlFragment = "\n
\n

Raspberry Pi

\n \n

The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.

\n More info about the Raspberry Pi\n

£29.95

\n

\n \n 9.2 out of \n 10 \n based on 178 reviews\n \n

\n

Categories: \n Computer, \n Education\n

\n

From: \n The Raspberry Pi Foundation - \n \n Cambridge \n UK\n \n

\n
"; + var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"review":[{"value":"9.2 out of \n 10 \n based on 178 reviews","type":["h-review-aggregate"],"properties":{"rating":["9.2"],"average":["9.2"],"best":["10"],"count":["178"]}}],"category":["Computer","Education"],"brand":[{"value":"The Raspberry Pi Foundation","type":["h-card"],"properties":{"name":["The Raspberry Pi Foundation"],"org":["The Raspberry Pi Foundation"],"adr":[{"value":"Cambridge \n UK","type":["h-adr"],"properties":{"locality":["Cambridge"],"country-name":["UK"]}}]}}]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/computer","http://en.wikipedia.org/wiki/education"]},"rel-urls":{"http://en.wikipedia.org/wiki/computer":{"text":"Computer","rels":["tag"]},"http://en.wikipedia.org/wiki/education":{"text":"Education","rels":["tag"]}}}; + + it('aggregate', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js new file mode 100644 index 000000000..7ec61f27b --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hproduct/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hproduct', function() { + var htmlFragment = "\n
\n

Raspberry Pi

\n \n

The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.

\n More info about the Raspberry Pi\n

£29.95

\n

4.5 out of 5

\n

Categories: \n Computer, \n Education\n

\n
"; + var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"category":["Computer","Education"],"review":[{"value":"4.5 out of 5","type":["h-review"],"properties":{"rating":["4.5"]}}]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/computer","http://en.wikipedia.org/wiki/education"]},"rel-urls":{"http://en.wikipedia.org/wiki/computer":{"text":"Computer","rels":["tag"]},"http://en.wikipedia.org/wiki/education":{"text":"Education","rels":["tag"]}}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js new file mode 100644 index 000000000..d580d68db --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hresume/affiliation +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hresume', function() { + var htmlFragment = "
\n

\n Tim Berners-Lee, \n invented the World Wide Web.\n

\n Belongs to following groups:\n

\n \n \"W3C\"\n \n

\n
"; + var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"]}}],"summary":["invented the World Wide Web"],"affiliation":[{"type":["h-card"],"properties":{"name":["W3C"],"photo":["http://www.w3.org/Icons/WWW/w3c_home_nb.png"]}}]}}],"rels":{},"rel-urls":{}}; + + it('affiliation', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js new file mode 100644 index 000000000..595087af4 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hresume/contact +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hresume', function() { + var htmlFragment = "
\n
\n

Tim Berners-Lee

\n

MIT

\n

\n 32 Vassar Street, \n Room 32-G524, \n Cambridge, \n MA \n 02139, \n USA. \n (Work)\n

\n

Tel:+1 (617) 253 5702

\n

Email:timbl@w3.org

\n
\n

Invented the World Wide Web.

\n
"; + var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"org":["MIT"],"adr":[{"value":"32 Vassar Street, \n Room 32-G524, \n Cambridge, \n MA \n 02139, \n USA. \n (Work)","type":["h-adr"],"properties":{"street-address":["32 Vassar Street"],"extended-address":["Room 32-G524"],"locality":["Cambridge"],"region":["MA"],"postal-code":["02139"],"country-name":["USA"]}}],"tel":["+1 (617) 253 5702"],"email":["mailto:timbl@w3.org"]}}],"summary":["Invented the World Wide Web."]}}],"rels":{},"rel-urls":{}}; + + it('contact', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js new file mode 100644 index 000000000..7a0114f53 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hresume/education +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hresume', function() { + var htmlFragment = "
\n
\n

Tim Berners-Lee

\n

Director of the World Wide Web Foundation

\n
\n

Invented the World Wide Web.


\n

\n The Queen's College, Oxford University, \n BA Hons (I) Physics \n –\n \n

\n
"; + var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"job-title":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"education":[{"value":"The Queen's College, Oxford University","type":["h-event","h-card"],"properties":{"name":["The Queen's College, Oxford University"],"org":["The Queen's College, Oxford University"],"description":["BA Hons (I) Physics"],"start":["1973-09"],"end":["1976-06"]}}]}}],"rels":{},"rel-urls":{}}; + + it('education', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js new file mode 100644 index 000000000..b08256700 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hresume/skill +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hresume', function() { + var htmlFragment = "
\n

\n Tim Berners-Lee, \n invented the World Wide Web.\n

\n Skills: \n \n
"; + var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"]}}],"summary":["invented the World Wide Web"],"skill":["information systems","advocacy","leadership"]}}],"rels":{"tag":["http://example.com/skills/informationsystems","http://example.com/skills/advocacy","http://example.com/skills/leadership"]},"rel-urls":{"http://example.com/skills/informationsystems":{"text":"information systems","rels":["tag"]},"http://example.com/skills/advocacy":{"text":"advocacy","rels":["tag"]},"http://example.com/skills/leadership":{"text":"leadership","rels":["tag"]}}}; + + it('skill', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js new file mode 100644 index 000000000..4ece3a389 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hresume/work +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hresume', function() { + var htmlFragment = "\n
\n
\n

Tim Berners-Lee

\n

Director of the World Wide Web Foundation

\n
\n

Invented the World Wide Web.


\n
\n

Director

\n

World Wide Web Foundation

\n

\n – Present\n \n

\n
\n
"; + var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"job-title":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"experience":[{"value":"World Wide Web Foundation","type":["h-event","h-card"],"properties":{"job-title":["Director"],"name":["World Wide Web Foundation"],"org":["World Wide Web Foundation"],"url":["http://www.webfoundation.org/"],"start":["2009-01-18"],"duration":["P2Y11M"]}}]}}],"rels":{},"rel-urls":{}}; + + it('work', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js new file mode 100644 index 000000000..6cdf65484 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hreview-aggregate/hcard +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hreview-aggregate', function() { + var htmlFragment = "
\n
\n

Mediterranean Wraps

\n

\n \n 433 S California Ave, \n Palo Alto, \n CA - \n \n (650) 321-8189\n

\n
\n

\n 9.2 out of \n 10 \n based on 17 reviews\n

\n
"; + var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-item","h-card"],"properties":{"name":["Mediterranean Wraps"],"org":["Mediterranean Wraps"],"adr":[{"value":"433 S California Ave, \n Palo Alto, \n CA","type":["h-adr"],"properties":{"street-address":["433 S California Ave"],"locality":["Palo Alto"],"region":["CA"]}}],"tel":["(650) 321-8189"]}}],"rating":["9.2"],"average":["9.2"],"best":["10"],"count":["17"]}}],"rels":{},"rel-urls":{}}; + + it('hcard', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js new file mode 100644 index 000000000..56d106fdb --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hreview-aggregate/justahyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hreview-aggregate', function() { + var htmlFragment = "

\n \n Mediterranean Wraps\n - Rated: \n 4.5 out of 5 (6 reviews)\n

"; + var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-item"],"properties":{"name":["Mediterranean Wraps"],"url":["http://example.com/mediterraneanwraps"]}}],"rating":["4.5"],"count":["6"]}}],"rels":{},"rel-urls":{}}; + + it('justahyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js new file mode 100644 index 000000000..896bbdc1d --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hreview-aggregate/vevent +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hreview-aggregate', function() { + var htmlFragment = "
\n
\n

Fullfrontal

\n

A one day JavaScript Conference held in Brighton

\n

\n
\n \n

\n 9.9 out of \n 10 \n based on 62 reviews\n

\n
"; + var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Fullfrontal","type":["h-item","h-event"],"properties":{"name":["Fullfrontal"],"description":["A one day JavaScript Conference held in Brighton"],"start":["2012-11-09"]}}],"rating":["9.9"],"average":["9.9"],"best":["10"],"count":["62"]}}],"rels":{},"rel-urls":{}}; + + it('vevent', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js new file mode 100644 index 000000000..4a00ac46a --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hreview/item +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hreview', function() { + var htmlFragment = "\n
\n

\n \n Crepes on Cole\n

\n

5 out of 5 stars

\n
"; + var expected = {"items":[{"type":["h-review"],"properties":{"item":[{"value":"Crepes on Cole","type":["h-item"],"properties":{"photo":["http://example.com/images/photo.gif"],"name":["Crepes on Cole"],"url":["http://example.com/crepeoncole"]}}],"rating":["5"]}}],"rels":{},"rel-urls":{}}; + + it('item', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js new file mode 100644 index 000000000..d59decb7f --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/hreview/vcard +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('hreview', 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"]}}],"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-item","h-card"],"properties":{"name":["Crepes on Cole"],"org":["Crepes on Cole"],"adr":[{"value":"San Francisco","type":["h-adr"],"properties":{"locality":["San Francisco"]}}]}}],"category":["crepe"],"url":["http://example.com/crepe"]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/crepe"],"self":["http://example.com/crepe"],"bookmark":["http://example.com/crepe"],"license":["http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"]},"rel-urls":{"http://en.wikipedia.org/wiki/crepe":{"text":"crepe","rels":["tag"]},"http://example.com/crepe":{"text":"http://example.com/crepe","rels":["self","bookmark"]},"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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js new file mode 100644 index 000000000..5ffa373d7 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/includes/hcarditemref +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('includes', function() { + var htmlFragment = "
\n Brendan Eich\n
\n
\n Mitchell Baker\n
\n\n

Mozilla

\n

\n 665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A. \n

"; + var expected = {"items":[{"type":["h-card"],"properties":{"org":["Mozilla"],"adr":[{"value":"665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A.","type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}]}},{"type":["h-card"],"properties":{"org":["Mozilla"],"adr":[{"value":"665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A.","type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}]}},{"type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}],"rels":{},"rel-urls":{}}; + + it('hcarditemref', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js new file mode 100644 index 000000000..b3a16025b --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/includes/heventitemref +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('includes', function() { + var htmlFragment = "
\n Monetizing Android Apps - spaekers: \n Chrix Finne, \n Kenneth Lui - \n \n Room 10\n \n
\n
\n New Low-Level Media APIs in Android - spaekers: \n Dave Burke -\n \n Room 11\n \n
\n\n

\n Session 01 is between: \n to \n \n

\n

\n Moscone Center, \n San Francisco \n

"; + var expected = {"items":[{"type":["h-event"],"properties":{"location":[{"value":"Room 10\n \n Moscone Center, \n San Francisco","type":["h-adr"],"properties":{"extended-address":["Room 10","Moscone Center"],"locality":["San Francisco"]}}],"start":["2012-06-27 15:45:00-08:00"],"end":["2012-06-27 16:45:00-08:00"]}},{"type":["h-event"],"properties":{"location":[{"value":"Room 11\n \n Moscone Center, \n San Francisco","type":["h-adr"],"properties":{"extended-address":["Room 11","Moscone Center"],"locality":["San Francisco"]}}],"start":["2012-06-27 15:45:00-08:00"],"end":["2012-06-27 16:45:00-08:00"]}}],"rels":{},"rel-urls":{}}; + + it('heventitemref', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js new file mode 100644 index 000000000..3a789bb1b --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/includes/hyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('includes', function() { + var htmlFragment = "
\n Ben Ward\n Twitter\n
\n
\n Dan Webb\n Twitter\n
\n\n
\n

Twitter

\n

\n 1355 Market St,\n San Francisco, \n CA\n 94103\n

\n
"; + var expected = {"items":[{"type":["h-card"],"properties":{"org":["Twitter"],"adr":[{"value":"1355 Market St,\n San Francisco, \n CA\n 94103","type":["h-adr"],"properties":{"street-address":["1355 Market St"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94103"]}}]}},{"type":["h-card"],"properties":{"org":["Twitter"],"adr":[{"value":"1355 Market St,\n San Francisco, \n CA\n 94103","type":["h-adr"],"properties":{"street-address":["1355 Market St"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94103"]}}]}},{"type":["h-adr"],"properties":{"street-address":["1355 Market St"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94103"]}}],"rels":{},"rel-urls":{}}; + + it('hyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js new file mode 100644 index 000000000..3bc15bd45 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/includes/object +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('includes', function() { + var htmlFragment = "
\n HTML5 & CSS3 latest features in action! - \n David Rousset -\n \n \n
\n
\n Building High-Performing JavaScript for Modern Engines -\n John-David Dalton and \n Amanda Silver -\n \n \n
\n\n\n
\n

Build Conference

\n

\n Redmond, \n Washington, \n USA\n

\n
"; + var expected = {"items":[{"type":["h-event"],"properties":{"start":["2012-10-30 11:45:00-08:00"],"name":["Build Conference"],"location":[{"value":"Redmond, \n Washington, \n USA","type":["h-adr"],"properties":{"locality":["Redmond"],"region":["Washington"],"country-name":["USA"]}}]}},{"type":["h-event"],"properties":{"start":["2012-10-31 11:15:00-08:00"],"name":["Build Conference"],"location":[{"value":"Redmond, \n Washington, \n USA","type":["h-adr"],"properties":{"locality":["Redmond"],"region":["Washington"],"country-name":["USA"]}}]}},{"type":["h-adr"],"properties":{"locality":["Redmond"],"region":["Washington"],"country-name":["USA"]}}],"rels":{},"rel-urls":{}}; + + it('object', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js new file mode 100644 index 000000000..a0d3ef55c --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v1/includes/table +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('includes', function() { + var htmlFragment = "\n\n \n \n \n \n \n \n \n \n \n
Opera
Chris Mills
Erik Möller
"; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Chris Mills"],"url":["http://dev.opera.com/"],"org":["Opera"]}},{"type":["h-card"],"properties":{"name":["Erik Möller"],"url":["http://dev.opera.com/"],"org":["Opera"]}}],"rels":{},"rel-urls":{}}; + + it('table', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js new file mode 100644 index 000000000..8ed7d747d --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-adr/geo +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-adr', function() { + var htmlFragment = "

\n Bricklayer's Arms\n \n 3 Charlotte Road, \n City of London, \n EC2A 3PE, \n UK \n – \n Geo:(51.526421;-0.081067) \n

"; + var expected = {"items":[{"type":["h-adr"],"properties":{"name":["Bricklayer's Arms"],"label":["3 Charlotte Road, \n City of London, \n EC2A 3PE, \n UK"],"street-address":["3 Charlotte Road"],"locality":["City of London"],"postal-code":["EC2A 3PE"],"country-name":["UK"],"geo":["51.526421;-0.081067"]}}],"rels":{},"rel-urls":{}}; + + it('geo', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js new file mode 100644 index 000000000..b97e76f60 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-adr/geourl +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-adr', function() { + var htmlFragment = "

\n Bricklayer's Arms, \n London \n

"; + var expected = {"items":[{"type":["h-adr"],"properties":{"name":["Bricklayer's Arms"],"geo":["geo:51.526421;-0.081067;crs=wgs84;u=40"],"locality":["London"],"url":["geo:51.526421;-0.081067;crs=wgs84;u=40"]}}],"rels":{},"rel-urls":{}}; + + it('geourl', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js new file mode 100644 index 000000000..c943fbafc --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-adr/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-adr', function() { + var htmlFragment = "

665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.

"; + var expected = {"items":[{"type":["h-adr"],"properties":{"name":["665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A."]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js new file mode 100644 index 000000000..084dac440 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-adr/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-adr', function() { + var htmlFragment = "

\n 665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A. \n

"; + var expected = {"items":[{"type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."],"name":["665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A."]}}],"rels":{},"rel-urls":{}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js new file mode 100644 index 000000000..7e0ac260c --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-as-note/note +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-as-note', function() { + var htmlFragment = "\n\n\n
  • \n
    \n \n
    \n
    In reply to:\n

    \n http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\n

    \n

    \n https://twitter.com/benwerd/status/604733231284383744\n

    \n
    \n
    \n \"Tantek\n

    \n @benwerd\n @erinjoalso proud of you &\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!

    \n \n \n on\n \n \n (ttk.me t4bT2)using\n BBEdit\n \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \"\" \n View \n Conversation\n on Twitter\n\n
    \n
  • "; + var expected = {"items":[{"type":["h-entry","h-as-note"],"properties":{"in-reply-to":[{"value":"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far","type":["h-cite"],"properties":{"name":["http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far"],"url":["http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far"]}},{"value":"https://twitter.com/benwerd/status/604733231284383744","type":["h-cite"],"properties":{"name":["https://twitter.com/benwerd/status/604733231284383744"],"url":["https://twitter.com/benwerd/status/604733231284383744"]}}],"author":[{"type":["h-card"],"properties":{"name":["Tantek Çelik"],"photo":["http://tantek.com/images/photo.gif"],"url":["http://tantek.com/"]}}],"name":["@benwerd\n @erinjoalso proud of you &\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!"],"content":[{"value":"@benwerd\n @erinjoalso proud of you &\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!","html":"\n @benwerd\n @erinjoalso proud of you &\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!"}],"published":["2015-06-01 22:20-07:00"],"updated":["2015-06-01 22:20-07:00"],"url":["http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy"],"uid":["http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy"],"syndication":["https://twitter.com/t/status/605604965566906369"]},"children":[{"value":"@benwerd","type":["h-x-username"],"properties":{"name":["@benwerd"],"url":["https://twitter.com/benwerd"]}},{"value":"@erinjo","type":["h-x-username"],"properties":{"name":["@erinjo"],"url":["https://twitter.com/erinjo"]}},{"value":"@withknown","type":["h-x-username"],"properties":{"name":["@withknown"],"url":["https://twitter.com/withknown"]}}]}],"rels":{"prev":["http://tantek.com/152/t1/congrats-fellow-elected-w3cab-members"],"next":["http://tantek.com/152/t3/going-indiewebcamp-2015-portland"],"in-reply-to":["http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far","https://twitter.com/benwerd/status/604733231284383744"],"author":["http://tantek.com/"],"syndication":["https://twitter.com/t/status/605604965566906369"]},"rel-urls":{"http://tantek.com/152/t1/congrats-fellow-elected-w3cab-members":{"title":"View the previous (older) item in the stream.","text":"←","rels":["prev"]},"http://tantek.com/152/t3/going-indiewebcamp-2015-portland":{"title":"View the next (newer) item in the stream","text":"→","rels":["next"]},"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far":{"text":"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far","rels":["in-reply-to"]},"https://twitter.com/benwerd/status/604733231284383744":{"text":"https://twitter.com/benwerd/status/604733231284383744","rels":["in-reply-to"]},"http://tantek.com/":{"title":"Tantek Çelik","rels":["author"]},"https://twitter.com/t/status/605604965566906369":{"text":"View \n Conversation\n on Twitter","rels":["syndication"]}}}; + + it('note', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js new file mode 100644 index 000000000..d098db392 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/baseurl +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "\n
    \n Mitchell Baker \n (Mozilla Foundation)\n \n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"],"org":[{"value":"Mozilla Foundation","type":["h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://example.org/bios/mitchell-baker/"]}}],"photo":["http://example.org/images/photo.gif"]}}],"rels":{},"rel-urls":{}}; + + it('baseurl', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js new file mode 100644 index 000000000..3ab1fa8ca --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/childimplied +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "\n\n
    \n

    Håkon Wium Lie

    \n \n
    \n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Håkon Wium Lie"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/H%C3%A5kon-Wium-Lie-2009-03.jpg/215px-H%C3%A5kon-Wium-Lie-2009-03.jpg"],"url":["http://people.opera.com/howcome/"]}}],"rels":{},"rel-urls":{}}; + + it('childimplied', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js new file mode 100644 index 000000000..8ee35b022 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/extendeddescription +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "
    \n \"photo\n

    \n Mitchell Baker\n (@MitchellBaker)\n Mozilla Foundation\n

    \n

    Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities.

    \n

    Strategy and Leadership

    \n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"photo":["http://blog.mozilla.org/press/files/2012/04/mitchell-baker.jpg"],"url":["http://blog.lizardwrangler.com/","https://twitter.com/MitchellBaker"],"name":["Mitchell Baker"],"org":["Mozilla Foundation"],"note":["Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities."],"category":["Strategy","Leadership"]}}],"rels":{},"rel-urls":{}}; + + it('extendeddescription', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js new file mode 100644 index 000000000..961381610 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/hcard +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "
    \n Mitchell Baker \n (Mozilla Foundation)\n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"url":["http://blog.lizardwrangler.com/"],"name":["Mitchell Baker"],"org":[{"value":"Mozilla Foundation","type":["h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}]}}],"rels":{},"rel-urls":{}}; + + it('hcard', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js new file mode 100644 index 000000000..bc6329ae6 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/horghcard +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "
    \n Mitchell Baker \n (Mozilla Foundation)\n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"],"org":[{"value":"Mozilla Foundation","type":["h-card","h-org"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}]}}],"rels":{},"rel-urls":{}}; + + it('horghcard', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js new file mode 100644 index 000000000..70febcb84 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/hyperlinkedphoto +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "\n \"Rohit\n "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Rohit Khare"],"photo":["http://example.com/images/photo.gif"],"url":["http://rohit.khare.org/"]}}],"rels":{},"rel-urls":{}}; + + it('hyperlinkedphoto', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js new file mode 100644 index 000000000..bcf45aecb --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/impliedname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "\n\"Jane\n\"Jane\nJD\n\n
    \"Jane
    \n
    \"Jane
    \n
    JD
    \n\n
    \"Jane
    \n
    \"Jane
    \n
    JD
    \n\n
    \"JohnName
    \n
    \"JohnName
    \n"; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]}},{"type":["h-card"],"properties":{"name":["Name"]},"children":[{"type":["h-card"],"properties":{"name":["John Doe"],"photo":["http://example.com/john.html"]}}]},{"type":["h-card"],"properties":{"name":["Name"]},"children":[{"value":"Name","type":["h-card"],"properties":{"name":["John Doe"],"photo":["http://example.com/john.html"]}}]}],"rels":{},"rel-urls":{}}; + + it('impliedname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js new file mode 100644 index 000000000..3248a1d0f --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/impliedphoto +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "\"Jane\nJane Doe\n\n
    \"Jane
    \n
    Jane Doe
    \n\n
    \"Jane
    \n
    Jane Doe
    \n\n
    \"JaneJane Doe
    \n
    Jane Doe
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]},"children":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}}]},{"type":["h-card"],"properties":{"name":["Jane Doe"]},"children":[{"value":"Jane Doe","type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}}]}],"rels":{},"rel-urls":{}}; + + it('impliedphoto', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js new file mode 100644 index 000000000..4034194ce --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/impliedurl +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "Jane Doe\n\"Jane\n
    Jane Doe

    \n
    Jane Doe

    \n
    Jane Doe

    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]},"children":[{"value":"Jane Doe","type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}}]}],"rels":{},"rel-urls":{}}; + + it('impliedurl', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js new file mode 100644 index 000000000..5911cc00f --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/justahyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "Ben Ward"; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Ben Ward"],"url":["http://benward.me/"]}}],"rels":{},"rel-urls":{}}; + + it('justahyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js new file mode 100644 index 000000000..4f239fab5 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "

    Frances Berriman

    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Frances Berriman"]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js new file mode 100644 index 000000000..da2336e29 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/nested +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "
    \n Mitchell Baker \n (Mozilla Foundation)\n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"]},"children":[{"value":"Mozilla Foundation","type":["h-org","h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}]}],"rels":{},"rel-urls":{}}; + + it('nested', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js new file mode 100644 index 000000000..0a365e34b --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/p-property +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "
    \n \n \n John \n P \n Doe \n \n \n \n \n
    BSc
    \n
    BA\n \n \n \"PHD\"\n \"company\n \n \"Madgex\"\n \"Mozilla\"\n \n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"given-name":["John"],"additional-name":["Peter"],"family-name":["Doe"],"honorific-suffix":["MSc","PHD"],"org":["Madgex","Mozilla"]}}],"rels":{},"rel-urls":{}}; + + it('p-property', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js new file mode 100644 index 000000000..712a8cf72 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-card/relativeurls +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-card', function() { + var htmlFragment = "\n
    \n Mitchell Baker \n (Mozilla Foundation)\n \n
    "; + var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"],"org":[{"value":"Mozilla Foundation","type":["h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://example.com/bios/mitchell-baker/"]}}],"photo":["http://example.com/bios/mitchell-baker/picture.jpeg"]}}],"rels":{},"rel-urls":{}}; + + it('relativeurls', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js new file mode 100644 index 000000000..e729b48b0 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-entry/impliedvalue-nested +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-entry', function() { + var htmlFragment = "
    \n
    \n \n Example Author\n Home\n \n Example Post\n
    \n
    "; + var expected = {"items":[{"type":["h-entry"],"properties":{"in-reply-to":[{"type":["h-cite"],"properties":{"name":["Example Post"],"url":["http://example.com/post"],"author":[{"type":["h-card"],"properties":{"url":["http://example.com"],"name":["Example Author"]},"value":"Example Author"}]},"value":"http://example.com/post"}],"name":["Example Author\n Home\n \n Example Post"]}}],"rels":{},"rel-urls":{}}; + + it('impliedvalue-nested', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js new file mode 100644 index 000000000..1e793e727 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-entry/justahyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-entry', function() { + var htmlFragment = "microformats.org at 7"; + var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"]}}],"rels":{},"rel-urls":{}}; + + it('justahyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js new file mode 100644 index 000000000..f4d31bf87 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-entry/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-entry', function() { + var htmlFragment = "

    microformats.org at 7

    "; + var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js new file mode 100644 index 000000000..b697f6c7c --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-entry/summarycontent +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-entry', function() { + var htmlFragment = "\n
    \n

    microformats.org at 7

    \n
    \n

    Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

    \n\n

    The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

    \n
    \n

    Updated \n by\n Tantek\n

    \n
    "; + var expected = {"items":[{"type":["h-entry"],"properties":{"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"name":["microformats.org at 7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n

    Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

    \n\n

    The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

    \n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"rels":{},"rel-urls":{}}; + + it('summarycontent', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js new file mode 100644 index 000000000..510f0aa90 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-entry/u-property +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-entry', function() { + var htmlFragment = "\n
    \n

    microformats.org at 7

    \n\n \n

    \n \n Article permalink\n

    \n

    \n http://microformats.org/ - \n 2012/06/25/microformats-org-at-7 \n

    \n\n

    Article permalink

    \n\n \"company\n \n \"microformats.org\"\n \n\n \"company\n\n \n\n value-class-pattern \n \n

    http://microformats.org/discuss

    \n
    "; + var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/","http://microformats.org/2012/06/25/microformats-org-at-7","http://microformats.org/2012/06/25/microformats-org-at-7","http://microformats.org/","http://microformats.org/wiki/microformats2-parsing","http://microformats.org/wiki/value-class-pattern","http://microformats.org/wiki/","http://microformats.org/discuss"],"photo":["http://example.com/images/logo.gif"]}}],"rels":{},"rel-urls":{}}; + + it('u-property', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js new file mode 100644 index 000000000..295ac9925 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-entry/urlincontent +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-entry', function() { + var htmlFragment = "
    \n

    Expanding URLs within HTML content

    \n \n
    "; + var expected = {"items":[{"type":["h-entry"],"properties":{"name":["Expanding URLs within HTML content"],"content":[{"value":"Should not change: http://www.w3.org/\n Should not change: http://example.com/\n File relative: test.html = http://example.com/test.html\n Directory relative: /test/test.html = http://example.com/test/test.html\n Relative to root: /test.html = http://example.com/test.html","html":"\n \n \n "}]}}],"rels":{},"rel-urls":{}}; + + it('urlincontent', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js new file mode 100644 index 000000000..814c3c42e --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/ampm +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "\n The 4th Microformat party will be on \n \n"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00","2009-06-26 07:00:00","2009-06-26 19:00","2009-06-26 19","2009-06-26 19","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 07:00"]}}],"rels":{},"rel-urls":{}}; + + it('ampm', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js new file mode 100644 index 000000000..2315dbe91 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/attendees +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "\n
    \n CPJ Online Press Freedom Summit\n () in\n San Francisco.\n Attendees:\n \n
    \n"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["CPJ Online Press Freedom Summit"],"start":["2012-10-10"],"location":["San Francisco"],"attendee":[{"value":"Brian Warner","type":["h-card"],"properties":{"name":["Brian Warner"]}},{"value":"Kyle Machulis","type":["h-card"],"properties":{"name":["Kyle Machulis"]}},{"value":"Tantek Çelik","type":["h-card"],"properties":{"name":["Tantek Çelik"]}},{"value":"Sid Sutter","type":["h-card"],"properties":{"name":["Sid Sutter"]}}]}}],"rels":{},"rel-urls":{}}; + + it('attendees', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js new file mode 100644 index 000000000..e91b381ba --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/combining +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "
    \n \n IndieWebCamp 2012\n \n from \n to at \n \n Geoloqi, \n 920 SW 3rd Ave. Suite 400, \n Portland, \n OR\n \n
    "; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"],"url":["http://indiewebcamp.com/2012"],"start":["2012-06-30"],"end":["2012-07-01"],"location":[{"value":"Geoloqi","type":["h-card"],"properties":{"name":["Geoloqi"],"org":["Geoloqi"],"url":["http://geoloqi.com/"],"street-address":["920 SW 3rd Ave. Suite 400"],"locality":["Portland"],"region":["Oregon"]}}]}}],"rels":{},"rel-urls":{}}; + + it('combining', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js new file mode 100644 index 000000000..897210674 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/concatenate +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "\n The 4th Microformat party will be on \n \n , from\n to \n .\n"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00"],"end":["2009-06-26 22:00"]}}],"rels":{},"rel-urls":{}}; + + it('concatenate', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js new file mode 100644 index 000000000..c26b5bccc --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/dates +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "
    \n\t

    The 4th Microformat party will be on:

    \n\t\n
    "; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00-08:00","2009-06-26 19:00-08","2009-06-26 19:00-08:00","2009-06-26 19:00+08:00","2009-06-26 19:00+08:00","2009-06-26 19:00Z","2009-06-26 19:00-08:00","2009-06-26 19:00:00-08:00"]}}],"rels":{},"rel-urls":{}}; + + it('dates', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js new file mode 100644 index 000000000..eb97beccb --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/dt-property +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "\n The party will be on \n \n

    \n \n March 14th 2013\n

    \n

    \n , from\n 07:00:00am \n

    \n \n

    \n \n \n Just added, \n Removed\n

    \n June 29 \n \n

    2013-07-02

    \n \n
    "; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The party"],"start":["2013-03-14","2013-06-25 07:00:00","2013-06-26","2013-06-27","2013-06-28","2013-06-29","2013-07-01","2013-07-02"]}}],"rels":{},"rel-urls":{}}; + + it('dt-property', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js new file mode 100644 index 000000000..26c835863 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/justahyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "IndieWebCamp 2012"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"],"url":["http://indiewebcamp.com/2012"]}}],"rels":{},"rel-urls":{}}; + + it('justahyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js new file mode 100644 index 000000000..be3a5335d --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "

    IndieWebCamp 2012

    "; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js new file mode 100644 index 000000000..243b518bf --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-event/time +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-event', function() { + var htmlFragment = "\n The 4th Microformat party will be on \n \n"; + var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00-08:00","2009-06-26 19:00:00-08:00","2009-06-26 19:00:00+08:00","2009-06-26 19:00:00Z","2009-06-26 19:00:00","2009-06-26 19:00-08:00","2009-06-26 19:00+08:00","2009-06-26 19:00Z","2009-06-26 19:00"],"end":["2013-034","2013-06-27 15:34"]}}],"rels":{},"rel-urls":{}}; + + it('time', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js new file mode 100644 index 000000000..30bbf52df --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-feed/implied-title +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-feed', function() { + var htmlFragment = "\n\n\t\n\t\tmicroformats blog\n\t\n\t\n\t
    \n\t\t\n\t\t
    \n\t\t

    microformats.org at 7

    \n\t\t
    \n\t\t

    Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.

    \n\t\t\n\t\t

    The microformats tagline “humans first, machines second” \n\t\t forms the basis of many of our \n\t\t principles, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service

    \n\t\t
    \n\t\t

    Updated \n\t\t \n\t\t

    \n\t\t
    \n\t\t\n\t
    \n\t\n"; + var expected = {"items":[{"type":["h-feed"],"properties":{"name":["microformats blog"]},"children":[{"value":"microformats.org at 7\n\t\t \n\t\t Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.\n\t\t\n\t\t The microformats tagline “humans first, machines second” \n\t\t forms the basis of many of our \n\t\t principles, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service \n\t\t \n\t\t Updated \n\t\t June 25th, 2012","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.\n\t\t\n\t\t The microformats tagline “humans first, machines second” \n\t\t forms the basis of many of our \n\t\t principles, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service","html":"\n\t\t

    Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.

    \n\t\t\n\t\t

    The microformats tagline “humans first, machines second” \n\t\t forms the basis of many of our \n\t\t principles, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service

    \n\t\t "}],"summary":["Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities."],"updated":["2012-06-25 17:08:26"]}}]}],"rels":{},"rel-urls":{}}; + + it('implied-title', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js new file mode 100644 index 000000000..c72b24140 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-feed/simple +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-feed', function() { + var htmlFragment = "
    \n\t

    Microformats blog

    \n\tTantek\n\tpermlink\n\t\n\t\n\t
    \n\t

    microformats.org at 7

    \n\t
    \n\t

    Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.

    \n\t\n\t

    The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service

    \n\t
    \n\t

    Updated \n\t \n\t

    \n\t
    \n\t\n
    "; + var expected = {"items":[{"type":["h-feed"],"properties":{"name":["Microformats blog"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}],"url":["http://microformats.org/blog"],"photo":["http://example.com/photo.jpeg"]},"children":[{"value":"microformats.org at 7\n\t \n\t Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service \n\t \n\t Updated \n\t June 25th, 2012","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service","html":"\n\t

    Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.

    \n\t\n\t

    The microformats tagline “humans first, machines second” \n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service

    \n\t "}],"summary":["Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities."],"updated":["2012-06-25 17:08:26"]}}]}],"rels":{},"rel-urls":{}}; + + it('simple', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js new file mode 100644 index 000000000..d26e9ed0d --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-geo/abbrpattern +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-geo', function() { + var htmlFragment = "\n

    \n N 37° 24.491, \n W 122° 08.313\n

    "; + var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["37.408183"],"longitude":["-122.13855"],"name":["N 37° 24.491, \n W 122° 08.313"]}}],"rels":{},"rel-urls":{}}; + + it('abbrpattern', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js new file mode 100644 index 000000000..45da683ff --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-geo/altitude +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-geo', function() { + var htmlFragment = "

    My favourite hill in the lakes is \n \n Pen-y-ghent \n (Geo: 54.155278,\n -2.249722). It\n raises to 694m.\n \n

    "; + var expected = {"items":[{"type":["h-geo"],"properties":{"name":["Pen-y-ghent"],"latitude":["54.155278"],"longitude":["-2.249722"],"altitude":["694"]}}],"rels":{},"rel-urls":{}}; + + it('altitude', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js new file mode 100644 index 000000000..968ed1285 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-geo/hidden +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-geo', function() { + var htmlFragment = "

    \n The Bricklayer's Arms\n \n \n \n \n \n \n \n

    "; + var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"],"name":["The Bricklayer's Arms"]}}],"rels":{},"rel-urls":{}}; + + it('hidden', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js new file mode 100644 index 000000000..23c142462 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-geo/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-geo', function() { + var htmlFragment = "

    On my way to The Bricklayer's Arms\n (Geo: 51.513458;-0.14812)\n

    "; + var expected = {"items":[{"type":["h-geo"],"properties":{"name":["51.513458;-0.14812"]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js new file mode 100644 index 000000000..e9700a3e2 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-geo/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-geo', function() { + var htmlFragment = "

    We are meeting at \n The Bricklayer's Arms\n (Geo: 51.513458:\n -0.14812)\n

    "; + var expected = {"items":[{"type":["h-geo"],"properties":{"name":["The Bricklayer's Arms"],"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js new file mode 100644 index 000000000..813d21592 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-geo/valuetitleclass +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-geo', function() { + var htmlFragment = "\n

    \n \n \n N 51° 51.345, \n \n \n W -0° 14.812\n \n \n

    "; + var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"],"name":["N 51° 51.345, \n \n \n W -0° 14.812"]}}],"rels":{},"rel-urls":{}}; + + it('valuetitleclass', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js new file mode 100644 index 000000000..a7deb3f2f --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-news/all +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-news', function() { + var htmlFragment = "
    \n
    \n

    microformats.org at 7

    \n
    \n

    Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

    \n\n

    The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

    \n
    \n

    Updated \n by\n Tantek\n

    \n
    \n\n

    \n \n (Geo: 37.774921;-122.445202) \n \n microformats.org\n \n

    \n

    \n Publishing policy\n

    \n
    "; + var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n

    Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

    \n\n

    The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

    \n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"dateline":[{"value":"San Francisco, \n CA","type":["h-adr"],"properties":{"locality":["San Francisco"],"region":["CA"],"name":["San Francisco, \n CA"]}}],"geo":["37.774921;-122.445202"],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"url":["http://microformats.org/"]}}],"principles":["http://microformats.org/wiki/Category:public_domain_license"],"name":["microformats.org at 7\n \n Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service \n \n Updated \n June 25th, 2012 by\n Tantek\n \n \n\n \n \n San Francisco, \n CA \n \n (Geo: 37.774921;-122.445202) \n \n microformats.org\n \n \n \n Publishing policy"]}}],"rels":{},"rel-urls":{}}; + + it('all', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js new file mode 100644 index 000000000..4494cb8ab --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-news/minimum +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-news', function() { + var htmlFragment = "
    \n
    \n

    microformats.org at 7

    \n
    \n

    Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

    \n\n

    The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

    \n
    \n

    Updated \n by\n Tantek\n

    \n
    \n

    \n microformats.org \n

    \n
    "; + var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n

    Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.

    \n\n

    The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service

    \n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"url":["http://microformats.org/"]}}],"name":["microformats.org at 7\n \n Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second” \n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service \n \n Updated \n June 25th, 2012 by\n Tantek\n \n \n \n microformats.org"]}}],"rels":{},"rel-urls":{}}; + + it('minimum', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js new file mode 100644 index 000000000..b7150aae4 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-org/hyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-org', function() { + var htmlFragment = "Mozilla Foundation"; + var expected = {"items":[{"type":["h-org"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}],"rels":{},"rel-urls":{}}; + + it('hyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js new file mode 100644 index 000000000..4f5a75e88 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-org/simple +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-org', function() { + var htmlFragment = "Mozilla Foundation"; + var expected = {"items":[{"type":["h-org"],"properties":{"name":["Mozilla Foundation"]}}],"rels":{},"rel-urls":{}}; + + it('simple', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js new file mode 100644 index 000000000..5c7e939e6 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-org/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-org', function() { + var htmlFragment = "

    \n W3C - \n CSS Working Group\n

    "; + var expected = {"items":[{"type":["h-org"],"properties":{"organization-name":["W3C"],"organization-unit":["CSS Working Group"],"name":["W3C - \n CSS Working Group"]}}],"rels":{},"rel-urls":{}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js new file mode 100644 index 000000000..b07d3f547 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-product/aggregate +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-product', function() { + var htmlFragment = "\n
    \n

    Raspberry Pi

    \n \n

    The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.

    \n More info about the Raspberry Pi\n

    £29.95

    \n

    \n \n 9.2 out of \n 10 \n based on 178 reviews\n \n

    \n

    Categories: Computer, Education

    \n

    From: \n The Raspberry Pi Foundation - \n Cambridge \n UK\n

    \n
    "; + var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"review":[{"value":"9.2 out of \n 10 \n based on 178 reviews","type":["h-review-aggregate"],"properties":{"rating":[{"value":"9.2 out of \n 10 \n based on 178 reviews","type":["h-rating"],"properties":{"average":["9.2"],"best":["10"],"count":["178"],"name":["9.2 out of \n 10 \n based on 178 reviews"]}}],"name":["9.2 out of \n 10 \n based on 178 reviews"]}}],"category":["Computer","Education"],"brand":[{"value":"The Raspberry Pi Foundation","type":["h-card"],"properties":{"name":["The Raspberry Pi Foundation"],"org":["The Raspberry Pi Foundation"],"locality":["Cambridge"],"country-name":["UK"]}}]}}],"rels":{},"rel-urls":{}}; + + it('aggregate', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js new file mode 100644 index 000000000..cf2638e31 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-product/justahyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-product', function() { + var htmlFragment = "Raspberry Pi"; + var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"url":["http://www.raspberrypi.org/"]}}],"rels":{},"rel-urls":{}}; + + it('justahyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js new file mode 100644 index 000000000..f946a10e0 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-product/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-product', function() { + var htmlFragment = "

    Raspberry Pi

    "; + var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js new file mode 100644 index 000000000..1c5467d51 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-product/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-product', function() { + var htmlFragment = "\n
    \n

    Raspberry Pi

    \n \n

    The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.

    \n More info about the Raspberry Pi\n

    £29.95

    \n

    4.5 out of 5

    \n

    Categories: Computer, Education

    \n
    "; + var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"category":["Computer","Education"],"review":[{"value":"4.5 out of 5","type":["h-review"],"properties":{"rating":["4.5"],"name":["4.5 out of 5"]}}]}}],"rels":{},"rel-urls":{}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js new file mode 100644 index 000000000..fa0e4cb37 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-recipe/all +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-recipe', function() { + var htmlFragment = "
    \n

    Yorkshire Puddings

    \n

    Makes 6 good sized Yorkshire puddings, the way my mum taught me

    \n\n\n

    \n\n \n \n 4.5 stars out 5 based on \n 35 reviews\n \n \n\n
    \n

    Ingredients

    \n
      \n
    • 1 egg
    • \n
    • 75g plain flour
    • \n
    • 70ml milk
    • \n
    • 60ml water
    • \n
    • Pinch of salt
    • \n
    \n
    \n\n

    Time

    \n \n\n\n

    Instructions

    \n
    \n
      \n
    1. Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \n Yorkshire pudding tins and place in the oven to heat through.
    2. \n \n
    3. To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \n Gradually add the milk and water while beating the mixture. It should be smooth and \n without lumps. Finally add a pinch of salt.
    4. \n \n
    5. Make sure the oil is piping hot before pouring the batter evenly into the tins. \n Place in the oven for 20-25 minutes until pudding have risen and look golden brown
    6. \n
    \n
    \n\n

    Nutrition

    \n \n

    (Amount per pudding)

    \n\n

    \n Published on by \n \n Glenn Jones\n \n

    \n Photo by dithie\n
    "; + var expected = {"items":[{"type":["h-recipe"],"properties":{"name":["Yorkshire Puddings"],"summary":["Makes 6 good sized Yorkshire puddings, the way my mum taught me"],"yield":["6 good sized Yorkshire puddings"],"photo":["http://codebits.glennjones.net/semantic/yorkshire-puddings.jpg"],"review":[{"value":"4.5 stars out 5 based on \n 35 reviews","type":["h-review-aggregate"],"properties":{"rating":["4.5 stars out 5 based on"],"average":["4.5"],"count":["35"],"name":["4.5 stars out 5 based on \n 35 reviews"]}}],"ingredient":[{"value":"1 egg","html":"1 egg"},{"value":"75g plain flour","html":"75g plain flour"},{"value":"70ml milk","html":"70ml milk"},{"value":"60ml water","html":"60ml water"},{"value":"Pinch of salt","html":"Pinch of salt"}],"instructions":[{"value":"Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \n Yorkshire pudding tins and place in the oven to heat through. \n \n To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \n Gradually add the milk and water while beating the mixture. It should be smooth and \n without lumps. Finally add a pinch of salt.\n \n Make sure the oil is piping hot before pouring the batter evenly into the tins. \n Place in the oven for 20-25 minutes until pudding have risen and look golden brown","html":"\n
      \n
    1. Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \n Yorkshire pudding tins and place in the oven to heat through.
    2. \n \n
    3. To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \n Gradually add the milk and water while beating the mixture. It should be smooth and \n without lumps. Finally add a pinch of salt.
    4. \n \n
    5. Make sure the oil is piping hot before pouring the batter evenly into the tins. \n Place in the oven for 20-25 minutes until pudding have risen and look golden brown
    6. \n
    \n "}],"nutrition":["Calories: 125","Fat: 3.2g","Cholesterol: 77mg"],"published":["2011-10-27"],"author":[{"value":"Glenn Jones","type":["h-card"],"properties":{"name":["Glenn Jones"],"url":["http://glennjones.net"]}}],"url":["http://www.flickr.com/photos/dithie/4106528495/"]}}],"rels":{},"rel-urls":{}}; + + it('all', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js new file mode 100644 index 000000000..ac3d91dc7 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-recipe/minimum +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-recipe', function() { + var htmlFragment = "
    \n

    Toast

    \n \n
    "; + var expected = {"items":[{"type":["h-recipe"],"properties":{"name":["Toast"],"ingredient":[{"value":"Slice of bread","html":"Slice of bread"},{"value":"Butter","html":"Butter"}]}}],"rels":{},"rel-urls":{}}; + + it('minimum', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js new file mode 100644 index 000000000..73329d46c --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-resume/affiliation +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-resume', function() { + var htmlFragment = "
    \n

    \n Tim Berners-Lee, \n invented the World Wide Web. \n

    \n Belongs to following groups:\n

    \n \n \"W3C\"\n \n

    \n
    "; + var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"summary":["invented the World Wide Web"],"affiliation":[{"type":["h-card"],"properties":{"name":["W3C"],"photo":["http://www.w3.org/Icons/WWW/w3c_home_nb.png"],"url":["http://www.w3.org/"]}}]}}],"rels":{},"rel-urls":{}}; + + it('affiliation', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js new file mode 100644 index 000000000..f2a1f76f7 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-resume/contact +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-resume', function() { + var htmlFragment = "
    \n

    Tim Berners-Lee

    \n

    Invented the World Wide Web.


    \n
    \n

    MIT

    \n

    \n 32 Vassar Street, \n Room 32-G524, \n Cambridge, \n MA \n 02139, \n USA.\n

    \n

    Tel:+1 (617) 253 5702

    \n

    Email:timbl@w3.org

    \n
    \n
    "; + var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"summary":["Invented the World Wide Web."],"contact":[{"value":"MIT","type":["h-card"],"properties":{"name":["MIT"],"street-address":["32 Vassar Street"],"extended-address":["Room 32-G524"],"locality":["Cambridge"],"region":["MA"],"postal-code":["02139"],"country-name":["USA"],"tel":["+1 (617) 253 5702"],"email":["mailto:timbl@w3.org"]}}]}}],"rels":{},"rel-urls":{}}; + + it('contact', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js new file mode 100644 index 000000000..5e3838434 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-resume/education +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-resume', function() { + var htmlFragment = "
    \n

    Tim Berners-Lee

    \n
    \n

    Director of the World Wide Web Foundation

    \n
    \n

    Invented the World Wide Web.


    \n

    \n The Queen's College, Oxford University, \n BA Hons (I) Physics \n –\n \n

    \n
    "; + var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"contact":[{"value":"Director of the World Wide Web Foundation","type":["h-card"],"properties":{"title":["Director of the World Wide Web Foundation"],"name":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"education":[{"value":"The Queen's College, Oxford University","type":["h-event","h-card"],"properties":{"name":["The Queen's College, Oxford University"],"org":["The Queen's College, Oxford University"],"description":["BA Hons (I) Physics"],"start":["1973-09"],"end":["1976-06"]}}]}}],"rels":{},"rel-urls":{}}; + + it('education', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js new file mode 100644 index 000000000..2357bf1a2 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-resume/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-resume', function() { + var htmlFragment = "

    Tim Berners-Lee, invented the World Wide Web.

    "; + var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee, invented the World Wide Web."]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js new file mode 100644 index 000000000..60a983e04 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-resume/skill +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-resume', function() { + var htmlFragment = "
    \n

    \n Tim Berners-Lee, \n invented the World Wide Web.\n

    \n Skills: \n
    "; + var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"summary":["invented the World Wide Web"],"skill":["information systems","advocacy","leadership"]}}],"rels":{},"rel-urls":{}}; + + it('skill', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js new file mode 100644 index 000000000..d61ea3de5 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-resume/work +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-resume', function() { + var htmlFragment = "\n
    \n

    Tim Berners-Lee

    \n
    \n

    Director of the World Wide Web Foundation

    \n
    \n

    Invented the World Wide Web.


    \n
    \n

    Director

    \n

    World Wide Web Foundation

    \n

    \n – Present\n \n

    \n
    \n
    "; + var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"contact":[{"value":"Director of the World Wide Web Foundation","type":["h-card"],"properties":{"title":["Director of the World Wide Web Foundation"],"name":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"experience":[{"value":"World Wide Web Foundation","type":["h-event","h-card"],"properties":{"title":["Director"],"name":["World Wide Web Foundation"],"org":["World Wide Web Foundation"],"url":["http://www.webfoundation.org/"],"start":["2009-01-18"],"duration":["P2Y11M"]}}]}}],"rels":{},"rel-urls":{}}; + + it('work', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js new file mode 100644 index 000000000..e698ee37a --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review-aggregate/hevent +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-review-aggregate', function() { + var htmlFragment = "
    \n
    \n

    Fullfrontal

    \n

    A one day JavaScript Conference held in Brighton

    \n

    \n
    \n \n

    \n 9.9 out of \n 10 \n based on 62 reviews\n

    \n
    "; + var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Fullfrontal","type":["h-event"],"properties":{"name":["Fullfrontal"],"description":["A one day JavaScript Conference held in Brighton"],"start":["2012-11-09"]}}],"rating":["9.9"],"average":["9.9"],"best":["10"],"count":["62"],"name":["Fullfrontal\n A one day JavaScript Conference held in Brighton\n 9th November 2012 \n \n \n \n 9.9 out of \n 10 \n based on 62 reviews"]}}],"rels":{},"rel-urls":{}}; + + it('hevent', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js new file mode 100644 index 000000000..729fdfb2d --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review-aggregate/justahyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-review-aggregate', function() { + var htmlFragment = "
    \n

    Mediterranean Wraps

    \n \n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n \n 4.5 out of 5 \n
    "; + var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-item"],"properties":{"name":["Mediterranean Wraps"]}}],"summary":["Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff."],"rating":["4.5"],"name":["Mediterranean Wraps\n \n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n \n 4.5 out of 5"]}}],"rels":{},"rel-urls":{}}; + + it('justahyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js new file mode 100644 index 000000000..d49cabb5f --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review-aggregate/simpleproperties +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-review-aggregate', function() { + var htmlFragment = "
    \n
    \n

    Mediterranean Wraps

    \n

    \n 433 S California Ave, \n Palo Alto, \n CA - \n (650) 321-8189\n

    \n
    \n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n \n 9.2 out of \n 10 \n based on 17 reviews\n \n
    "; + var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-card"],"properties":{"name":["Mediterranean Wraps"],"street-address":["433 S California Ave"],"locality":["Palo Alto"],"region":["CA"],"tel":["(650) 321-8189"]}}],"summary":["Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff."],"rating":["9.2"],"average":["9.2"],"best":["10"],"count":["17"],"name":["Mediterranean Wraps\n \n 433 S California Ave, \n Palo Alto, \n CA - \n (650) 321-8189\n \n \n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n \n 9.2 out of \n 10 \n based on 17 reviews"]}}],"rels":{},"rel-urls":{}}; + + it('simpleproperties', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js new file mode 100644 index 000000000..3f547d7a9 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review/hyperlink +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-review', function() { + var htmlFragment = "Crepes on Cole"; + var expected = {"items":[{"type":["h-review"],"properties":{"name":["Crepes on Cole"],"url":["https://plus.google.com/116941523817079328322/about"]}}],"rels":{},"rel-urls":{}}; + + it('hyperlink', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js new file mode 100644 index 000000000..ecde19277 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review/implieditem +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 Crepes on Cole\n

    4.7 out of 5 stars

    \n
    "; + var expected = {"items":[{"type":["h-review"],"properties":{"item":[{"value":"Crepes on Cole","type":["h-item"],"properties":{"name":["Crepes on Cole"],"url":["http://example.com/crepeoncole"]}}],"rating":["4.7"],"name":["Crepes on Cole\n 4.7 out of 5 stars"]}}],"rels":{},"rel-urls":{}}; + + it('implieditem', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js new file mode 100644 index 000000000..d8aef51c8 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review/item +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
    \n

    \n \n Crepes on Cole\n

    \n

    5 out of 5 stars

    \n
    "; + var expected = {"items":[{"type":["h-review"],"properties":{"item":[{"value":"Crepes on Cole","type":["h-item"],"properties":{"photo":["http://example.com/images/photo.gif"],"name":["Crepes on Cole"],"url":["http://example.com/crepeoncole"]}}],"rating":["5"],"name":["Crepes on Cole\n \n 5 out of 5 stars"]}}],"rels":{},"rel-urls":{}}; + + it('item', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js new file mode 100644 index 000000000..89523e909 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review/justaname +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-review', function() { + var htmlFragment = "

    Crepes on Cole

    "; + var expected = {"items":[{"type":["h-review"],"properties":{"name":["Crepes on Cole"]}}],"rels":{},"rel-urls":{}}; + + it('justaname', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js new file mode 100644 index 000000000..ee0c41fe6 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/h-review/photo +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('h-review', function() { + var htmlFragment = "\"Crepes"; + var expected = {"items":[{"type":["h-review"],"properties":{"name":["Crepes on Cole"],"photo":["http://example.com/images/photo.gif"]}}],"rels":{},"rel-urls":{}}; + + it('photo', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js new file mode 100644 index 000000000..8411c4d2a --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js @@ -0,0 +1,27 @@ +/* +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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js new file mode 100644 index 000000000..d65dfdf8b --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/rel/duplicate-rels +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('rel', function() { + var htmlFragment = "\n\nAsides\n\nMatt\n\nAsides\nMatt\n"; + var expected = {"rels":{"bookmark":["http://ma.tt/2015/05/beethoven-mozart-bach/","http://ma.tt/2015/06/jefferson-on-idleness/"],"category":["http://ma.tt/category/asides/"],"tag":["http://ma.tt/category/asides/"],"author":["http://ma.tt/author/saxmatt/"]},"items":[{"type":["h-card"],"properties":{"url":["http://ma.tt/author/saxmatt/"],"name":["Matt"]}},{"type":["h-card"],"properties":{"url":["http://ma.tt/author/saxmatt/"],"name":["Matt"]}}],"rel-urls":{"http://ma.tt/category/asides/":{"rels":["category","tag"],"text":"Asides"},"http://ma.tt/author/saxmatt/":{"rels":["author"],"text":"Matt","title":"View all posts by Matt"},"http://ma.tt/2015/05/beethoven-mozart-bach/":{"rels":["bookmark"],"text":"May 31, 2015","title":"Permalink to Beethoven, Mozart, Bach"},"http://ma.tt/2015/06/jefferson-on-idleness/":{"rels":["bookmark"],"text":"June 2, 2015","title":"Permalink to Jefferson on Idleness"}}}; + + it('duplicate-rels', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js new file mode 100644 index 000000000..d5606f5a3 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/rel/license +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('rel', function() { + var htmlFragment = "cc by 2.5"; + var expected = {"items":[],"rels":{"license":["http://creativecommons.org/licenses/by/2.5/"]},"rel-urls":{"http://creativecommons.org/licenses/by/2.5/":{"text":"cc by 2.5","rels":["license"]}}}; + + it('license', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js new file mode 100644 index 000000000..4332d3572 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/rel/nofollow +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('rel', function() { + var htmlFragment = "Copyrights"; + var expected = {"items":[],"rels":{"nofollow":["http://microformats.org/wiki/microformats:copyrights"]},"rel-urls":{"http://microformats.org/wiki/microformats:copyrights":{"text":"Copyrights","rels":["nofollow"]}}}; + + it('nofollow', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js new file mode 100644 index 000000000..685532f44 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/rel/rel-urls +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('rel', function() { + var htmlFragment = "author a\nauthor b\npost 1\npost 2\nFrench mobile homepage"; + var expected = {"items":[],"rels":{"author":["http://example.com/a","http://example.com/b"],"in-reply-to":["http://example.com/1","http://example.com/2"],"home":["http://example.com/fr"],"alternate":["http://example.com/fr"]},"rel-urls":{"http://example.com/a":{"rels":["author"],"text":"author a"},"http://example.com/b":{"rels":["author"],"text":"author b"},"http://example.com/1":{"rels":["in-reply-to"],"text":"post 1"},"http://example.com/2":{"rels":["in-reply-to"],"text":"post 2"},"http://example.com/fr":{"rels":["alternate","home"],"media":"handheld","hreflang":"fr","text":"French mobile homepage"}}}; + + it('rel-urls', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js new file mode 100644 index 000000000..3b1b72f44 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/rel/varying-text-duplicate-rels +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('rel', function() { + var htmlFragment = "This is a contrived example - not found links like this in the wild:\nAsides\nB-sides\nseasides"; + var expected = {"rels":{"category":["http://ma.tt/category/asides/"],"tag":["http://ma.tt/category/asides/"]},"items":[],"rel-urls":{"http://ma.tt/category/asides/":{"rels":["category","tag"],"text":"Asides"}}}; + + it('varying-text-duplicate-rels', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js new file mode 100644 index 000000000..3850ad564 --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/rel/xfn-all +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('rel', function() { + var htmlFragment = ""; + var expected = {"items":[],"rels":{"friend":["http://example.com/profile/jane"],"acquaintance":["http://example.com/profile/jeo"],"contact":["http://example.com/profile/lily"],"met":["http://example.com/profile/oliver"],"co-worker":["http://example.com/profile/emily"],"colleague":["http://example.com/profile/jack"],"neighbor":["http://example.com/profile/isabella"],"child":["http://example.com/profile/harry"],"parent":["http://example.com/profile/sophia"],"sibling":["http://example.com/profile/charlie"],"spouse":["http://example.com/profile/olivia"],"kin":["http://example.com/profile/james"],"muse":["http://example.com/profile/ava"],"crush":["http://example.com/profile/joshua"],"date":["http://example.com/profile/chloe"],"sweetheart":["http://example.com/profile/alfie"],"me":["http://example.com/profile/isla"]},"rel-urls":{"http://example.com/profile/jane":{"text":"jane","rels":["friend"]},"http://example.com/profile/jeo":{"text":"jeo","rels":["acquaintance"]},"http://example.com/profile/lily":{"text":"lily","rels":["contact"]},"http://example.com/profile/oliver":{"text":"oliver","rels":["met"]},"http://example.com/profile/emily":{"text":"emily","rels":["co-worker"]},"http://example.com/profile/jack":{"text":"jack","rels":["colleague"]},"http://example.com/profile/isabella":{"text":"isabella","rels":["neighbor"]},"http://example.com/profile/harry":{"text":"harry","rels":["child"]},"http://example.com/profile/sophia":{"text":"sophia","rels":["parent"]},"http://example.com/profile/charlie":{"text":"charlie","rels":["sibling"]},"http://example.com/profile/olivia":{"text":"olivia","rels":["spouse"]},"http://example.com/profile/james":{"text":"james","rels":["kin"]},"http://example.com/profile/ava":{"text":"ava","rels":["muse"]},"http://example.com/profile/joshua":{"text":"joshua","rels":["crush"]},"http://example.com/profile/chloe":{"text":"chloe","rels":["date"]},"http://example.com/profile/alfie":{"text":"alfie","rels":["sweetheart"]},"http://example.com/profile/isla":{"text":"isla","rels":["me"]}}}; + + it('xfn-all', 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); + }); +}); diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js new file mode 100644 index 000000000..d982af5cc --- /dev/null +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js @@ -0,0 +1,27 @@ +/* +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Mocha integration test from: microformats-v2/rel/xfn-elsewhere +The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) +*/ + +assert = chai.assert; + + +describe('rel', function() { + var htmlFragment = ""; + var expected = {"items":[],"rels":{"me":["http://twitter.com/glennjones","http://delicious.com/glennjonesnet/","https://plus.google.com/u/0/105161464208920272734/about","http://lanyrd.com/people/glennjones/","http://github.com/glennjones","http://www.flickr.com/photos/glennjonesnet/","http://www.linkedin.com/in/glennjones","http://www.slideshare.net/glennjones/presentations"]},"rel-urls":{"http://twitter.com/glennjones":{"text":"twitter","rels":["me"]},"http://delicious.com/glennjonesnet/":{"text":"delicious","rels":["me"]},"https://plus.google.com/u/0/105161464208920272734/about":{"text":"google+","rels":["me"]},"http://lanyrd.com/people/glennjones/":{"text":"lanyrd","rels":["me"]},"http://github.com/glennjones":{"text":"github","rels":["me"]},"http://www.flickr.com/photos/glennjonesnet/":{"text":"flickr","rels":["me"]},"http://www.linkedin.com/in/glennjones":{"text":"linkedin","rels":["me"]},"http://www.slideshare.net/glennjones/presentations":{"text":"slideshare","rels":["me"]}}}; + + it('xfn-elsewhere', 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); + }); +}); -- cgit v1.2.3