Commit 367a9718 authored by flothoni's avatar flothoni Committed by Mathieu Giraud

shared clones; add tests Qunit and functional

parent 667c2e1c
......@@ -3371,7 +3371,7 @@ changeAlleleNotation: function(alleleNotation) {
getSampleWithSelectedClones: function(){
var selected = this.getSelected()
if (selected.length == 0) {
return this.samples.actifs
return this.samples.order
}
var list = []
......
......@@ -606,6 +606,26 @@ QUnit.test("computeOrderWithStock", function(assert) {
assert.deepEqual( m.samples.stock_order, waited, "Correct stock_order if apply m.switchTimeOrder")
});
QUnit.test("getSampleWithSelectedClones", function(assert) {
var m = new Model();
m.parseJsonData(json_data, 100)
m.initClones()
// clone 1 present only in sample 1 and 2
m.clones[1].reads[2] = 0
m.clones[1].reads[3] = 0
// clone 2 present only in sample 2 and 3
m.clones[2].reads[0] = 0
m.clones[2].reads[3] = 0
assert.deepEqual( m.getSampleWithSelectedClones(), [0,1,2,3], "no selection, should return list of all actives samples")
m.select(1)
assert.deepEqual( m.getSampleWithSelectedClones(), [0,1], "clone 1, should return samples 1 and 2")
m.select(2)
assert.deepEqual( m.getSampleWithSelectedClones(), [0,1,2], "clone 1 and 2, should return samples 1 and 2 and 3")
});
......@@ -174,7 +174,28 @@ class TestGraph < BrowserTest
$b.table(:id => "visu2_table").wait_while(&:present?)
end
def test_07_graphlist_filter_on_shared_clones
$b.div(:id => 'visu2_menu').hover
$b.table(:id => "visu2_table").wait_until(&:present?)
$b.td(:id => 'visu2_listElem_showAll').click
$b.clone_in_list('4').click
# Assert on checkbox at init
assert ( $check0.set? ), "first checkbox is true"
assert ( $check1.set? ), "second checkbox is true"
# By default, checkbox are true
$b.div(:id => 'visu2_menu').hover
$b.table(:id => "visu2_table").wait_until(&:present?)
$b.td(:id => 'visu2_listElem_hideNotShare').click
$b.update_icon.wait_while(&:present?) # wait update
# Assert on checkbox after filter on shared clones
assert ( $check0.set? ), "first checkbox is true"
assert ( !$check1.set? ), "second checkbox is false"
end
# Not really a test
def test_zz_close
......
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