diff --git a/frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js b/frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
index d17ed86cb05d633f18f20f25f0071a8457f93379..9bb28be683532ea7e618a7dfef493fb90b5f7aa1 100644
--- a/frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
+++ b/frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
@@ -139,7 +139,7 @@ CommentsAdminPanel.prototype.onProjectChange = function () {
     dataTable.clear().rows.add(data).draw();
     $("[name='commentsTable']", self.getElement()).on("click", "[name='removeComment']", function () {
       var button = this;
-      return self.askConfirmRemoval().then(function (param) {
+      return self.askConfirmRemoval({title: "Why do you want to remove this comment?"}).then(function (param) {
         if (param.status) {
           return ServerConnector.removeComment({
             commentId: $(button).attr("data"),
@@ -211,18 +211,22 @@ CommentsAdminPanel.prototype.destroy = function () {
   }
 };
 
-CommentsAdminPanel.prototype.askConfirmRemoval = function () {
+CommentsAdminPanel.prototype.askConfirmRemoval = function (params) {
   return new Promise(function (resolve) {
     $('<form><input type="text" style="z-index:10000" name="name"><br></form>').dialog({
       modal: true,
-      title: "Why do you want to remove this comment?",
+      title: params.title,
+      close: function () {
+        $(this).dialog('destroy').remove();
+        resolve({status: false});
+      },
       buttons: {
         'OK': function () {
-          $(this).dialog('close');
+          $(this).dialog('destroy').remove();
           resolve({reason: $('input[name="name"]').val(), status: true});
         },
         'Cancel': function () {
-          $(this).dialog('close');
+          $(this).dialog('destroy').remove();
           resolve({status: false});
         }
       }
diff --git a/frontend-js/src/test/js/gui/admin/CommentsAdminPanel-test.js b/frontend-js/src/test/js/gui/admin/CommentsAdminPanel-test.js
new file mode 100644
index 0000000000000000000000000000000000000000..c7875b34271340cb154d889b20078b30f3fd7397
--- /dev/null
+++ b/frontend-js/src/test/js/gui/admin/CommentsAdminPanel-test.js
@@ -0,0 +1,78 @@
+"use strict";
+
+require("../../mocha-config");
+
+var CommentsAdminPanel = require('../../../../main/js/gui/admin/CommentsAdminPanel');
+var ServerConnector = require('../../ServerConnector-mock');
+
+
+var logger = require('../../logger');
+
+var fs = require("fs");
+var chai = require('chai');
+var assert = chai.assert;
+
+describe('CommentsAdminPanel', function () {
+  function createDialog() {
+    return ServerConnector.getConfiguration().then(function (configuration) {
+      return new CommentsAdminPanel({
+        element: testDiv,
+        configuration: configuration,
+        customMap: null
+      });
+    });
+  }
+
+  describe('askConfirmRemoval', function () {
+    it('check question', function () {
+      helper.loginAsAdmin();
+      return createDialog().then(function (dialog) {
+        var title = "Question?";
+        dialog.askConfirmRemoval({title: title});
+        assert.ok($(".ui-dialog-title").html().indexOf(title) >= 0);
+        $("button:contains(Cancel)").click();
+
+        return dialog.destroy();
+      });
+    });
+    it('check ok status', function () {
+      helper.loginAsAdmin();
+      var dialog;
+      return createDialog().then(function (result) {
+        dialog = result;
+        var promise = dialog.askConfirmRemoval({title: "Question?"});
+        $("button:contains(OK)").click();
+        return promise;
+      }).then(function (result) {
+        assert.ok(result.status);
+        return dialog.destroy();
+      });
+    });
+    it('check cancel status', function () {
+      helper.loginAsAdmin();
+      var dialog;
+      return createDialog().then(function (result) {
+        dialog = result;
+        var promise = dialog.askConfirmRemoval({title: "Question?"});
+        $("button:contains(Cancel)").click();
+        return promise;
+      }).then(function (result) {
+        assert.notOk(result.status);
+        return dialog.destroy();
+      });
+    });
+    it('check close confirmation status', function () {
+      helper.loginAsAdmin();
+      var dialog;
+      return createDialog().then(function (result) {
+        dialog = result;
+        var promise = dialog.askConfirmRemoval({title: "Question?"});
+        $(".ui-dialog-titlebar-close").click();
+        return promise;
+      }).then(function (result) {
+        assert.notOk(result.status);
+        return dialog.destroy();
+      });
+    });
+  });
+});
diff --git a/frontend-js/src/test/js/map/AbstractCustomMap-test.js b/frontend-js/src/test/js/map/AbstractCustomMap-test.js
index 1b76576dc5f6d32723a0c5b7602c09817b8a7828..011d3a71576b2b107f56890ad67623918747de63 100644
--- a/frontend-js/src/test/js/map/AbstractCustomMap-test.js
+++ b/frontend-js/src/test/js/map/AbstractCustomMap-test.js
@@ -356,7 +356,6 @@ describe('AbstractCustomMap', function () {
       var reaction = helper.createReaction(map);
       var center = map.getGoogleMap().getCenter();
       return map.fitBounds([reaction]).then(function () {
-
         var center2 = map.getGoogleMap().getCenter();
         assert.ok(center.lat() !== center2.lat() || center.lng() !== center2.lng());
       })
diff --git a/frontend-js/src/test/js/mocha-config.js b/frontend-js/src/test/js/mocha-config.js
index 2be1c6fc3de72a74c72c6298a47e2f13208ec0f6..9d2ffcb82298ee9ab74cf28c204c42147eebb1b5 100644
--- a/frontend-js/src/test/js/mocha-config.js
+++ b/frontend-js/src/test/js/mocha-config.js
@@ -159,5 +159,15 @@ afterEach(function () {
       $(window).off("resize");
       this.test.error(new Error("Test didn't left clean resize events handlers."));
     }
+  } else {
+    //when failed don't forget to clean events
+    if ($._data(window, "events").resize) {
+      logger.warn("Clearing events: " + $._data(window, "events").resize);
+      $(window).off("resize");
+    }
+    if (document.body.hasChildNodes()) {
+      logger.warn("Clearing html");
+      document.body.innerHTML = "";
+    }
   }
 });