Commit f8133d1f authored by flothoni's avatar flothoni

test_url, add test on selection of clones by url

Link to #4443
parent f771d865
Pipeline #160358 passed with stages
in 10 minutes and 58 seconds
......@@ -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