Simplified plugin registration and improved registration checks

Change-Id: I60486be70091a5bdc6c2703c73fe6adb52514f32
diff --git a/dev/js/spec/pluginSpec.js b/dev/js/spec/pluginSpec.js
index 62aa3c7..50c4982 100644
--- a/dev/js/spec/pluginSpec.js
+++ b/dev/js/spec/pluginSpec.js
@@ -17,6 +17,31 @@
       expect(div.firstChild.firstChild.tagName).toEqual("IFRAME");
       manager.destroy();
     });
+
+    it('should fail on invalid registries', function () {
+      var manager = pluginServerClass.create();
+
+      expect(
+	      function() { manager.register({}) }
+      ).toThrow(new Error("Missing name of plugin"));
+
+      expect(
+	      function() { manager.register({
+          name : 'Example',
+          embed : ''
+        })}
+      ).toThrow(new Error("Embedding of plugin is no list"));
+
+      expect(
+	      function() { manager.register({
+          name : 'Example',
+          embed : [{
+            panel : ''
+          }]
+        })}
+      ).toThrow(new Error("Panel for plugin is invalid"));
+
+    });
   });
 
   describe('KorAP.Plugin.Widget', function () {