Commit 1169a893 authored by Mikaël Salson's avatar Mikaël Salson

browser/tests: Test proper cluster selection with functional tests

Using QUnit, the test was not successful with nightmare.
Switching to functional test should solve the problem.
parent b3347e70
......@@ -168,64 +168,3 @@ QUnit.test("tag/norm", function(assert) {
assert.equal(m.clone(2).getSize(), 0.3125, "size after norm : Ok")
});
QUnit.test("cluster", function(assert) {
var m = new Model();
m.parseJsonData(json_data,100)
m.loadGermline()
m.initClones()
var list = new List("list","data",m);
list.init();
m.merge([1, 3, 4]);
var li_clone1 = document.getElementById('1');
var li_clone3 = document.getElementById('3');
var li_clone4 = document.getElementById('4');
setTimeout( function() {
assert.ok( $(li_clone1).is(':visible'), "clone merged, but main clone should be visible");
assert.ok( ! $(li_clone3).is(':visible'), "clone merged should not be visible");
assert.ok( ! $(li_clone4).is(':visible'), "clone merged should not be visible");
}, 500);
var elements = $('[cloneid=1]');
assert.equal( elements.length, 1, "Only one element with cloneid = '1'");
list.showCluster(elements[0]);
li_clone1 = document.getElementById('1');
li_clone3 = document.getElementById('3');
li_clone4 = document.getElementById('4');
setTimeout( function() {
assert.ok( $(li_clone1).is(':visible'), "clone merged, but main clone should be visible");
assert.ok( $(li_clone3).is(':visible'), "clone merged should be visible");
assert.ok( $(li_clone4).is(':visible'), "clone merged should be visible");
}, 500);
list.hideCluster(elements[0]);
setTimeout( function() {
assert.ok( $(li_clone1).is(':visible'), "clone merged, but main clone should be visible");
assert.ok( ! $(li_clone3).is(':visible'), "clone merged should be visible");
assert.ok( ! $(li_clone4).is(':visible'), "clone merged should be visible");
}, 500);
m.select(1);
list.showCluster(elements[0]);
setTimeout( function() {
assert.ok(m.clones[1].isSelected(), "Clone 1 should be selected (main cluster)");
assert.ok(m.clones[3].isSelected(), "Clone 3 should be selected (opened cluster)");
assert.ok(m.clones[4].isSelected(), "Clone 4 should be selected (opened cluster)");
assert.ok(! m.clones[2].isSelected(), "Clone 2 should not be selected (not in cluster)");
}, 500);
list.hideCluster(elements[0]);
setTimeout( function() {
assert.ok(m.clones[1].isSelected(), "Clone 1 should be selected (main cluster)");
assert.ok(! m.clones[3].isSelected(), "Clone 3 should not be selected (closed cluster)");
assert.ok(! m.clones[4].isSelected(), "Clone 4 should not be selected (closed cluster)");
assert.ok(! m.clones[2].isSelected(), "Clone 2 should not be selected (not in cluster)");
}, 500);
});
......@@ -129,6 +129,30 @@ end
assert (not $b.clone_in_scatterplot('2').visible?)
end
def test_08_select_cluster
$b.clone_in_scatterplot('1').click
clustered = $b.clone_info('1')
assert ($b.clone_in_scatterplot('1', :class => "circle_select").exists?)
assert ($b.clone_in_graph('1', :class=> "graph_select").exists?)
assert ($b.clone_in_segmenter('1').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
assert ( not $b.clone_in_scatterplot('2', :class => "circle_select").exists?)
assert ( not $b.clone_in_graph('2', :class=> "graph_select").exists?)
assert ( not $b.clone_in_segmenter('2').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
clustered[:cluster].click
assert ($b.clone_in_scatterplot('1', :class => "circle_select").exists?)
assert ($b.clone_in_graph('1', :class=> "graph_select").exists?)
assert ($b.clone_in_segmenter('1').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
assert ( $b.clone_in_scatterplot('2', :class => "circle_select").exists?)
assert ( $b.clone_in_graph('2', :class=> "graph_select").exists?)
assert ( $b.clone_in_segmenter('2').exists? ), ">> fail to add clone to segmenter by clicking on the list or scatterplot"
clustered[:cluster].click
$b.unselect
end
def test_90_select_other
# Click on first point
$b.graph_x_legend('1').click
......
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