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 --- .../test/standards-tests/mf-v2-h-as-note-note.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js (limited to 'toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js') 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); + }); +}); -- cgit v1.2.3