Commit aa20efdd authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-c/4443-url-erreur-clone_isvirtual' into 'dev'

Resolve "nouvelles URL, erreur de chargement"

Closes #4443

See merge request !776
parents a8749f83 f8133d1f
Pipeline #160415 passed with stages
in 7 minutes and 55 seconds
......@@ -91,7 +91,8 @@ Url.prototype= {
var clones = this.url_dict.clone.split(',');
for (var j = 0; j < clones.length; j++) {
var c = this.m.clone(clones[j]);
if (typeof c !== "undefined" && !c.isVirtual()) {
if (typeof c !== "undefined" && (c.hasSizeConstant() || c.hasSizeDistrib())) {
// Only select constant clone
c.select = true;
}
}
......
......@@ -153,6 +153,35 @@ QUnit.test("url: parse", function(assert) { with (windowMock) {
});
}})
QUnit.test("url: select clones", function(assert) { with (windowMock) {
windowMock.history.pushState('plop', 'plop', 'mock://foo.bar?clone=1,2');
// create model
var m = new Model();
m.parseJsonData(json_data,100)
m.loadGermline()
m.initClones()
// Init scatterplot (before URL object)
var sp = new ScatterPlot("visu",m);
sp.init();
// Init ur manager
var url = new Url(m, windowMock);
m.url_manager = url;
// Verify that clones are correctly see
var params = url.parseUrlParams('?clone=1,2');
console.log( params )
assert.deepEqual(params, {
"clone": "1,2"
}, "test url parse correct url for clone selectionjjb ");
// Apply url selection on clones
m.url_manager.applyURL()
assert.notOk( m.clone(0).select, "Clone 0 should NOT be selected")
assert.ok( m.clone(1).select, "Clone 1 should be selected")
assert.ok( m.clone(2).select, "Clone 2 should be selected")
assert.notOk( m.clone(3).select, "Clone 3 should NOT be selected")
}})
QUnit.test("url: generate", function(assert) { with (windowMock) {
var params = {
'param1': 'first',
......
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