Bugs fixed: function clearButtons and a did not exist

Change-Id: I47e0f5f02ae2d355dea8c86c71fb07b8b87f39ec
diff --git a/dev/js/spec/pluginSpec.js b/dev/js/spec/pluginSpec.js
index f7514bd..b84fc65 100644
--- a/dev/js/spec/pluginSpec.js
+++ b/dev/js/spec/pluginSpec.js
@@ -190,5 +190,38 @@
       KorAP.Panel['query'] = undefined;
       manager.destroy();
     });
+  
+    it('Plugin buttons should be cleared after adding to panel', function () {
+      
+      // Register plugin first
+      KorAP.Plugin = pluginServerClass.create();
+
+      KorAP.Plugin.register({
+        name : 'Check',
+        embed : [{
+          panel : 'query',
+          title : 'Translate',
+          onClick : {
+            template : 'test'
+          }
+        }]
+      });
+
+
+      var queryPanel = queryPanelClass.create();
+      var div = document.createElement('div');
+
+      div.appendChild(queryPanel.element());
+      KorAP.Panel = KorAP.Panel || {};
+      KorAP.Panel['query'] = queryPanel;
+      expect(KorAP.Plugin.buttonGroup('query').length).toEqual(0);
+
+      // Clean up
+      KorAP.Panel['query'] = undefined;
+      KorAP.Plugin.destroy();
+      KorAP.Plugin = undefined;
+    });  
+      
+  
   });
 });