Commit 536c8468 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

tests: add tests

We would like to be able to restoreClusters() after a merge.
Opens #2335.
parent 2c766b8c
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment