diff --git a/mindplot/pom.xml b/mindplot/pom.xml
index 73050ea8..e35b75f6 100644
--- a/mindplot/pom.xml
+++ b/mindplot/pom.xml
@@ -280,7 +280,7 @@
-
+
header.js
diff --git a/mindplot/src/test/javascript/DesignerTestSuite.js b/mindplot/src/test/javascript/DesignerTestSuite.js
index 32c2fe38..d4f1c1eb 100644
--- a/mindplot/src/test/javascript/DesignerTestSuite.js
+++ b/mindplot/src/test/javascript/DesignerTestSuite.js
@@ -1,69 +1,68 @@
-var setup = function() {
- /*:DOC += */
- var mapId = '1';
- var mapXml = '';
- var editorProperties = {"zoom":0.7, size: {width: "1366px", height:"768px"}};
- var buildMindmapDesigner = function() {
+var designer = null;
+/*:DOC += */
+var mapId = '1';
+var mapXml = '';
+var editorProperties = {"zoom":0.7, size: {width: "1366px", height:"768px"}};
+var buildMindmapDesigner = function() {
- // Initialize message logger ...
- var container = $('');
- $("body").append(container);
+ // Initialize message logger ...
+ var container = $('');
+ $("body").append(container);
- // Initialize Editor ...
- var window = $(window);
- var screenWidth = window.width();
- var screenHeight = window.height();
+ // Initialize Editor ...
+ var window = $(window);
+ var screenWidth = window.width();
+ var screenHeight = window.height();
- // Positionate node ...
- // header - footer
- screenHeight = screenHeight - 90 - 61;
+ // Positionate node ...
+ // header - footer
+ screenHeight = screenHeight - 90 - 61;
- // body margin ...
- editorProperties.width = screenWidth;
- editorProperties.height = screenHeight;
+ // body margin ...
+ editorProperties.width = screenWidth;
+ editorProperties.height = screenHeight;
- var designer = new mindplot.Designer(editorProperties, container);
- /*var persistence = mindplot.PersistenceManager.getInstance();
- designer.loadMap(mapId, mapXml);
-*/
+ designer = new mindplot.Designer(editorProperties, container);
+ // Load map from XML file persisted on disk...
+ var persistence = new mindplot.LocalStorageManager("src/test/resources/welcome.xml");
+ var mindmap = persistence.load(mapId);
+ designer.loadMap(mindmap);
- /*// Save map on load ....
- if (editorProperties.saveOnLoad)
- {
- var saveOnLoad = function() {
- designer.save(function() {
- }, false);
- }.delay(1000)
- }*/
+ /*// Save map on load ....
+ if (editorProperties.saveOnLoad)
+ {
+ var saveOnLoad = function() {
+ designer.save(function() {
+ }, false);
+ }.delay(1000)
+ }*/
- }
- buildMindmapDesigner();
}
+buildMindmapDesigner();
describe("Designer test suite", function() {
- beforeEach(function() {
- //setup();
- });
it("testWorkspaceBuild", function(){
- var id = $(document).attr('id');
- expect(id).not.toBeNull();
- //expect(id).not.toBeUndefined();
+ var mindplot = $(document).find('#mindplot');
+ expect(mindplot).not.toBeNull();
+ expect(mindplot).not.toBeUndefined();
});
- /*testCentralTopicPresent:function(){
- var centralTopic = designer.getCentralTopic();
- assertNotNull(centralTopic);
+ it("testCentralTopicPresent", function(){
+ var centralTopic = designer.getMindmap().getCentralTopic();
+ expect($defined(centralTopic)).toBe(true);
var position = centralTopic.getPosition();
- assertEquals(0,position.x);
- assertEquals(0,position.y);
- },
- testMouseCreateMainTopic:function(){
- var centralTopic = designer.getCentralTopic();
- assertNotNull(centralTopic);
+ expect(position.x).toEqual(0);
+ expect(position.y).toEqual(0);
+ });
+ /*it("testCentralTopicPresent", function(){
+ var centralTopic = designer.getMindmap().getCentralTopic();
+ expect($defined(centralTopic)).toBe(true);
var target = designer.getWorkSpace().getScreenManager().getContainer();
var size = designer.getModel().getTopics().length;
fireNativeEvent('dblclick',target,new core.Point(50,50));
assertEquals(size+1, designer.getModel().getTopics().length);
- }*/
+ });
+ */
+
});
\ No newline at end of file
diff --git a/mindplot/src/test/javascript/lib/web2d.svg-min.js b/mindplot/src/test/javascript/lib/web2d.svg-min.js
index 5fa894a4..33e91534 120000
--- a/mindplot/src/test/javascript/lib/web2d.svg-min.js
+++ b/mindplot/src/test/javascript/lib/web2d.svg-min.js
@@ -1 +1 @@
-../../../../web2d/target/classes/web2d.svg-min.js
\ No newline at end of file
+../../../../../web2d/target/classes/web2d.svg-min.js
\ No newline at end of file