Commit 27c3b09b authored by flothoni's avatar flothoni

model.js; update tests

link to #3697
parent a2a5658e
Pipeline #62010 passed with stages
in 5 minutes and 40 seconds
......@@ -1199,13 +1199,17 @@ changeAlleleNotation: function(alleleNotation) {
displayTop: function (top) {
top = typeof top !== 'undefined' ? top : this.top;
this.top = top;
if (top < 0)
top = 0
// Remember the top setted
// Allow to keep this values between various samples
this.top = top;
// top show cannot be greater than the number of clones
if (top > this.countRealClones())
top = this.countRealClones()
this.current_top = top
var html_slider = document.getElementById('top_slider');
if (html_slider !== null) {
......
......@@ -116,7 +116,8 @@ QUnit.test("top clones", function(assert) {
m.displayTop(-10)
assert.equal(m.top, 0, "Top cannot be negative")
m.displayTop(m.countRealClones() * 2 + 10)
assert.equal(m.top, m.countRealClones(), "Top cannot be greater than the number of real clones")
assert.equal(m.current_top, m.countRealClones(), "Top cannot be greater than the number of real clones")
m.displayTop(1)
......
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