From 8e8fb723ac564ad7a6ba84bb8e0cba38a01ca13c Mon Sep 17 00:00:00 2001 From: Omar Alshaker Date: Mon, 27 Nov 2017 11:19:47 +0100 Subject: [PATCH] Do not issue request for `undefined` hrefs --- juicy-html.html | 60 +++++++++++++++++++++++++--------------------- test/skipping.html | 8 +++++++ 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/juicy-html.html b/juicy-html.html index f3186e2..b760b3d 100644 --- a/juicy-html.html +++ b/juicy-html.html @@ -6,12 +6,12 @@ version: 2.0.1 --> + \ No newline at end of file diff --git a/test/skipping.html b/test/skipping.html index 8a29c06..ebe8609 100644 --- a/test/skipping.html +++ b/test/skipping.html @@ -86,6 +86,14 @@ expect(myEl.skipStampingPendingFile).not.to.be.called; }); }); + describe("Undefined URL", function() { + it("It shouldn't issue a request if URL is undefined", function() { + myEl = fixture('juicy-html-fixture').querySelector('template[is="juicy-html"]'); + sinon.spy(myEl, '_loadExternalFile'); + myEl.href = undefined; + expect(myEl._loadExternalFile).not.to.be.called; + }); + }); });