Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
cd4669b9
Commit
cd4669b9
authored
Jul 09, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: missing test for automatic graph layout
parent
7f8708ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
bt5/erp5_graph_editor/SkinTemplateItem/portal_skins/erp5_graph_editor/dream_graph_editor/jsplumb/test.js.js
...s/erp5_graph_editor/dream_graph_editor/jsplumb/test.js.js
+43
-0
No files found.
bt5/erp5_graph_editor/SkinTemplateItem/portal_skins/erp5_graph_editor/dream_graph_editor/jsplumb/test.js.js
View file @
cd4669b9
...
...
@@ -107,6 +107,27 @@
}
}
}
},
sample_graph_no_node_coodinate
=
{
edge
:
{
edge1
:
{
_class
:
"
Example.Edge
"
,
source
:
"
N1
"
,
destination
:
"
N2
"
,
color
:
"
blue
"
}
},
node
:
{
N1
:
{
_class
:
"
Example.Node
"
,
name
:
"
Node 1
"
,
shape
:
"
square
"
},
N2
:
{
_class
:
"
Example.Node
"
,
name
:
"
Node 2
"
,
shape
:
"
circle
"
}
}
},
sample_graph_not_connected
=
{
edge
:
{},
node
:
{
...
...
@@ -124,6 +145,9 @@
},
sample_data_graph
=
JSON
.
stringify
({
class_definition
:
sample_class_definition
,
graph
:
sample_graph
}),
sample_data_graph_no_node_coordinate
=
JSON
.
stringify
({
class_definition
:
sample_class_definition
,
graph
:
sample_graph_no_node_coodinate
}),
sample_data_graph_not_connected
=
JSON
.
stringify
({
class_definition
:
sample_class_definition
,
graph
:
sample_graph_not_connected
...
...
@@ -522,5 +546,24 @@
jsplumb_gadget
.
render
(
sample_data_empty_graph
);
}).
then
(
runTest
).
fail
(
error_handler
).
always
(
start
);
});
test
(
"
Graph is automatically layout
"
,
function
()
{
var
jsplumb_gadget
;
stop
();
g
.
declareGadget
(
"
./index.html
"
,
{
element
:
document
.
querySelector
(
"
#qunit-fixture
"
)
}).
then
(
function
(
new_gadget
)
{
jsplumb_gadget
=
new_gadget
;
return
jsplumb_gadget
.
render
(
sample_data_graph_no_node_coordinate
);
}).
then
(
function
()
{
return
jsplumb_gadget
.
getContent
();
}).
then
(
function
(
content
)
{
$
.
each
(
JSON
.
parse
(
content
).
graph
.
node
,
function
(
i
,
node
){
ok
(
node
.
coordinate
.
top
!==
undefined
,
"
Node have top coordinate
"
)
ok
(
0
<=
node
.
coordinate
.
top
<=
1
,
"
Node top coordinate is between [0..1]
"
)
ok
(
node
.
coordinate
.
left
!==
undefined
,
"
Node have left coordinate
"
)
ok
(
0
<=
node
.
coordinate
.
left
<=
1
,
"
Node left coordinate is between [0..1]
"
)
})
}).
fail
(
error_handler
).
always
(
start
);
});
});
})(
rJS
,
JSON
,
QUnit
,
RSVP
,
jQuery
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment