Commit b02d0e36 authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-c/4221-indication-graph-one-sample' into 'dev'

Resolve "Indication sur le graphe quand on affiche uniquement les clones d'un sample"

Closes #4221

See merge request !629
parents dd94f8bb 6a984e90
Pipeline #131745 failed with stages
in 15 minutes and 22 seconds
......@@ -1063,6 +1063,8 @@ Graph.prototype = {
time_name = this.m.getStrTime(l);
if (time_name.length > maxchar+3) time_name = time_name.substring(0,maxchar)+" ..."
if (l == this.m.t) time_name = this.m.getStrTime(l);
// If focus on this sample only (todo: #4221; add an search icon, hard with d3js)
if (this.m.show_only_one_sample && l == this.m.t) time_name += " *"
d.type = "axis_v";
d.text = time_name;
......
......@@ -55,14 +55,14 @@ class TestCluster < BrowserTest
def test_05_switch_onlyOneSample
cloneId = '4'
sleep 1
$b.update_icon.wait_while(&:present?)
# exist will not work as the clone is present, but not visible.
# So use the number of points of the line [with new smooth line, there is no formula]
polyline4 = $b.path(:id => "polyline"+cloneId )
assert ( polyline4.attribute_value("d").split(',').length == 12 ), ">> clone is present in the graph by default"
# switch the filter on, current sample include cloneId
### switch the filter ON, current sample include cloneId
$b.menu_filter.click
$b.div(:id => "filter_switch_sample").click
assert ( $b.clone_in_list(cloneId).exists? ), ">> clone is present in the list"
......@@ -72,9 +72,34 @@ class TestCluster < BrowserTest
# change current sample, will not include cloneId
$b.send_keys :arrow_right
sleep 1
$b.update_icon.wait_while(&:present?)
polyline4 = $b.path(:id => "polyline"+cloneId )
assert ( polyline4.attribute_value("d").split(',').length == 2 ), ">> clone is NOT present in the graph if switched in filter menu and sample with size at 0 for this clone"
## control if name get the '*' if focus on it
$time0 = $b.graph_x_legend("0")
$time1 = $b.graph_x_legend("1")
assert ( $time0.text == "2019-12-17" ), "label of timepoint 0 in graph don't have the '*'"
assert ( $time1.text == "+10 *" ), "label of timepoint 1 in graph have the '*'"
$b.send_keys :arrow_right
$b.update_icon.wait_while(&:present?)
assert ( $time0.text == "2019-12-17 *" ), "label of timepoint 0 in graph don't have the '*'"
assert ( $time1.text == "+10" ), "label of timepoint 1 in graph have the '*'"
# return to sample without clone4
$b.send_keys :arrow_right
$b.update_icon.wait_while(&:present?)
### switch the filter OFF
$b.menu_filter.click
$b.div(:id => "filter_switch_sample").click
$b.update_icon.wait_while(&:present?)
assert ( $time0.text == "2019-12-17" ), "label of timepoint 0 in graph still don't have the '*'"
assert ( $time1.text == "+10" ), "label of timepoint 1 in graph don't have the '*' anymore"
polyline4 = $b.path(:id => "polyline"+cloneId )
assert ( polyline4.attribute_value("d").split(',').length == 12 ), ">> clone is again present in the graph if switched in filter menu (in sample without it)"
end
......
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