Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
536c8468
Commit
536c8468
authored
Apr 05, 2017
by
Mathieu Giraud
Browse files
tests: add tests
We would like to be able to restoreClusters() after a merge. Opens
#2335
.
parent
2c766b8c
Changes
1
Show whitespace changes
Inline
Side-by-side
browser/test/QUnit/testFiles/model_test.js
View file @
536c8468
...
...
@@ -208,6 +208,12 @@ QUnit.test("cluster", function(assert) {
assert
.
deepEqual
(
m
.
clusters
[
0
],
[
0
,
1
,
2
],
"
merge [0,1] and 2: build cluster [0,1,2]
"
);
assert
.
equal
(
m
.
clone
(
0
).
getSize
(),
0.275
,
"
cluster [0,1,2] : getsize = 0.275
"
);
m
.
merge
([
0
,
4
])
assert
.
deepEqual
(
m
.
clusters
[
0
],
[
0
,
1
,
2
,
4
],
"
merge [0,1,2] and 4 -> [0,1,2,4]
"
);
m
.
restoreClusters
()
assert
.
deepEqual
(
m
.
clusters
[
0
],
[
0
,
1
,
2
],
"
restore previous clusters -> [0,1,2]
"
);
m
.
split
(
0
,
1
)
assert
.
deepEqual
(
m
.
clusters
[
0
],
[
0
,
2
],
"
remove clone 1 from cluster [0,1,2]: build cluster [0,2]
"
);
assert
.
equal
(
m
.
clone
(
0
).
getSize
(),
0.175
,
"
cluster [0,2] : getsize = 0.175
"
);
...
...
@@ -216,7 +222,7 @@ QUnit.test("cluster", function(assert) {
assert
.
deepEqual
(
m
.
clusters
[
0
],
[
0
,
1
,
3
],
"
clusterBy germline
"
);
m
.
restoreClusters
()
assert
.
deepEqual
(
m
.
clusters
[
0
],
[
0
,
2
],
"
restore previous clusters
(made by user with merge whithout using clusterby function)
"
);
assert
.
deepEqual
(
m
.
clusters
[
0
],
[
0
,
2
],
"
restore previous clusters
-> [0,2]
"
);
m
.
resetClusters
()
assert
.
deepEqual
(
m
.
clusters
,
[[
0
],[
1
],[
2
],[
3
],[
4
],[
5
],[
6
]],
"
resetClusters
"
);
...
...
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