mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-25 04:33:50 +01:00
mindplot integrated with jasmine, dummy test uploaded
This commit is contained in:
parent
a814366058
commit
e5b1e17e1f
@ -273,11 +273,90 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<preloadSources>
|
||||||
|
<source>libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js</source>
|
||||||
|
<source>lib/jquery-1.8.2.js</source>
|
||||||
|
<source>lib/core.js/</source>
|
||||||
|
<source>lib/web2d.svg-min.js</source>
|
||||||
|
<source>libraries/hotkeys/jquery.hotkeys.js</source>
|
||||||
|
<source>libraries/underscorejs/underscore-min.js</source>
|
||||||
|
</preloadSources>
|
||||||
<sourceIncludes>
|
<sourceIncludes>
|
||||||
<include>libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js</include>
|
|
||||||
<include>header.js</include>
|
<include>header.js</include>
|
||||||
<include>jquery-1.8.2.js</include>
|
|
||||||
<include>Events.js</include>
|
<include>Events.js</include>
|
||||||
|
<include>Messages.js</include>
|
||||||
|
<include>TopicEventDispatcher.js</include>
|
||||||
|
<include>model/IMindmap.js</include>
|
||||||
|
<include>model/Mindmap.js</include>
|
||||||
|
<include>model/INodeModel.js</include>
|
||||||
|
<include>model/NodeModel.js</include>
|
||||||
|
<include>model/RelationshipModel.js</include>
|
||||||
|
<include>ActionDispatcher.js</include>
|
||||||
|
<include>StandaloneActionDispatcher.js</include>
|
||||||
|
<include>DesignerModel.js</include>
|
||||||
|
<include>Designer.js</include>
|
||||||
|
<include>ScreenManager.js</include>
|
||||||
|
<include>Workspace.js</include>
|
||||||
|
<include>ShrinkConnector.js</include>
|
||||||
|
<include>Keyboard.js</include>
|
||||||
|
<include>DesignerKeyboard.js</include>
|
||||||
|
<include>Keyboard.js</include>
|
||||||
|
<include>TopicStyle.js</include>
|
||||||
|
<include>NodeGraph.js</include>
|
||||||
|
<include>Topic.js</include>
|
||||||
|
<include>CentralTopic.js</include>
|
||||||
|
<include>MainTopic.js</include>
|
||||||
|
<include>DragTopic.js</include>
|
||||||
|
<include>DragManager.js</include>
|
||||||
|
<include>DragPivot.js</include>
|
||||||
|
<include>ConnectionLine.js</include>
|
||||||
|
<include>Relationship.js</include>
|
||||||
|
<include>DragConnector.js</include>
|
||||||
|
<include>TextEditor.js</include>
|
||||||
|
<include>MultilineTextEditor.js</include>
|
||||||
|
<include>TextEditorFactory.js</include>
|
||||||
|
<include>util/Shape.js</include>
|
||||||
|
<include>util/FadeEffect.js</include>
|
||||||
|
<include>persistence/ModelCodeName.js</include>
|
||||||
|
<include>persistence/XMLSerializer_Pela.js</include>
|
||||||
|
<include>persistence/XMLSerializer_Tango.js</include>
|
||||||
|
<include>persistence/Pela2TangoMigrator.js</include>
|
||||||
|
<include>persistence/XMLSerializer_Beta.js</include>
|
||||||
|
<include>persistence/Beta2PelaMigrator.js</include>
|
||||||
|
<include>persistence/XMLSerializerFactory.js</include>
|
||||||
|
<include>PersistenceManager.js</include>
|
||||||
|
<include>RestPersistenceManager.js</include>
|
||||||
|
<include>LocalStorageManager.js</include>
|
||||||
|
<include>EditorProperties.js</include>
|
||||||
|
<include>IconGroup.js</include>
|
||||||
|
<include>Icon.js</include>
|
||||||
|
<include>LinkIcon.js</include>
|
||||||
|
<include>NoteIcon.js</include>
|
||||||
|
<include>ActionIcon.js</include>
|
||||||
|
<include>ImageIcon.js</include>
|
||||||
|
<include>model/FeatureModel.js</include>
|
||||||
|
<include>model/IconModel.js</include>
|
||||||
|
<include>model/LinkModel.js</include>
|
||||||
|
<include>model/NoteModel.js</include>
|
||||||
|
<include>Command.js</include>
|
||||||
|
<include>DesignerActionRunner.js</include>
|
||||||
|
<include>DesignerUndoManager.js</include>
|
||||||
|
<include>ControlPoint.js</include>
|
||||||
|
<include>EditorOptions.js</include>
|
||||||
|
<include>RelationshipPivot.js</include>
|
||||||
|
<include>TopicFeature.js</include>
|
||||||
|
<include>layout/EventBusDispatcher.js</include>
|
||||||
|
<include>layout/ChangeEvent.js</include>
|
||||||
|
<include>layout/LayoutManager.js</include>
|
||||||
|
<include>layout/Node.js</include>
|
||||||
|
<include>layout/RootedTreeSet.js</include>
|
||||||
|
<include>layout/ChildrenSorterStrategy.js</include>
|
||||||
|
<include>layout/AbstractBasicSorter.js</include>
|
||||||
|
<include>layout/BalancedSorter.js</include>
|
||||||
|
<include>layout/SymmetricSorter.js</include>
|
||||||
|
<include>layout/GridSorter.js</include>
|
||||||
|
<include>layout/OriginalLayout.js</include>
|
||||||
|
<include>layout/EventBus.js</include>
|
||||||
</sourceIncludes>
|
</sourceIncludes>
|
||||||
<specExcludes>
|
<specExcludes>
|
||||||
<exclude>static/test/*.js</exclude>
|
<exclude>static/test/*.js</exclude>
|
||||||
|
69
mindplot/src/test/javascript/DesignerTestSuite.js
Normal file
69
mindplot/src/test/javascript/DesignerTestSuite.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
var setup = function() {
|
||||||
|
/*:DOC += <div id="mindplot"></div> */
|
||||||
|
var mapId = '1';
|
||||||
|
var mapXml = '<map name="1" version="pela"><topic central="true" text="test" id="1"><topic position="103,-52" order="" id="2"/><topic position="-134,-75" order="" id="3"/><topic position="-126,5" order="" id="4"/><topic position="-115,53" order="" id="5"/><topic position="-136,-35" order="" id="6"/></topic></map>';
|
||||||
|
var editorProperties = {"zoom":0.7, size: {width: "1366px", height:"768px"}};
|
||||||
|
var buildMindmapDesigner = function() {
|
||||||
|
|
||||||
|
// Initialize message logger ...
|
||||||
|
var container = $('<div id="mindplot"></div>');
|
||||||
|
$("body").append(container);
|
||||||
|
|
||||||
|
// Initialize Editor ...
|
||||||
|
var window = $(window);
|
||||||
|
var screenWidth = window.width();
|
||||||
|
var screenHeight = window.height();
|
||||||
|
|
||||||
|
// Positionate node ...
|
||||||
|
// header - footer
|
||||||
|
screenHeight = screenHeight - 90 - 61;
|
||||||
|
|
||||||
|
// body margin ...
|
||||||
|
editorProperties.width = screenWidth;
|
||||||
|
editorProperties.height = screenHeight;
|
||||||
|
|
||||||
|
var designer = new mindplot.Designer(editorProperties, container);
|
||||||
|
/*var persistence = mindplot.PersistenceManager.getInstance();
|
||||||
|
designer.loadMap(mapId, mapXml);
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*// Save map on load ....
|
||||||
|
if (editorProperties.saveOnLoad)
|
||||||
|
{
|
||||||
|
var saveOnLoad = function() {
|
||||||
|
designer.save(function() {
|
||||||
|
}, false);
|
||||||
|
}.delay(1000)
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
/*testCentralTopicPresent:function(){
|
||||||
|
var centralTopic = designer.getCentralTopic();
|
||||||
|
assertNotNull(centralTopic);
|
||||||
|
var position = centralTopic.getPosition();
|
||||||
|
assertEquals(0,position.x);
|
||||||
|
assertEquals(0,position.y);
|
||||||
|
},
|
||||||
|
testMouseCreateMainTopic:function(){
|
||||||
|
var centralTopic = designer.getCentralTopic();
|
||||||
|
assertNotNull(centralTopic);
|
||||||
|
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);
|
||||||
|
}*/
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user