From 15effaa357b1997895a7b22bc6763563aa342a67 Mon Sep 17 00:00:00 2001 From: Josh Sanderson Date: Thu, 21 Dec 2017 14:20:56 -0500 Subject: [PATCH] fix(templating.js): reset caused duplicate template contents (#1945) --- client/js/templating.js | 1 + test/unit/templating.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/client/js/templating.js b/client/js/templating.js index f796d63a2..d2a493aac 100644 --- a/client/js/templating.js +++ b/client/js/templating.js @@ -650,6 +650,7 @@ qq.Templating = function(spec) { }, reset: function() { + container.innerHTML = ""; this.render(); }, diff --git a/test/unit/templating.js b/test/unit/templating.js index 0051bff13..8a09ac6a6 100644 --- a/test/unit/templating.js +++ b/test/unit/templating.js @@ -328,6 +328,11 @@ describe("templating.js", function() { assert.ok(!$fixture.find(".qq-upload-pause-selector").hasClass(HIDE_CSS)); assert.ok(!$fixture.find(".qq-upload-spinner-selector").hasClass(HIDE_CSS)); }); + + it("reset clears contents before appending new render", function() { + templating.reset() + assert.equal($fixture.find(".qq-uploader").length, 1); + }); }); describe("permanently hidden files tests", function() {