Commit ec62baf5 authored by aurelBZH's avatar aurelBZH Committed by Mathieu Giraud

tests: new tests, url.js

See #2190.
parent e91691e8
QUnit.module("Url", {
});
QUnit.test("clone : modifyURL", function(assert) {
var m = new Model();
m.parseJsonData(json_data,100)
var sp = new ScatterPlot("visu",m);
sp.init();
var url= new Url(m);
url.init();
sp.init();
// assert.equal(sp.select_preset.selectedIndex,1, "test selected index");
// assert.equal(sp.default_preset, 1, "test default_preset")
m.select(1)
m.update()
assert.equal(window.location.search.toString(),"?clone=1", "url is updated with the clone name");
assert.deepEqual(url.url_dict,{
"clone": "1"
}, "test url_dict")
m.multiSelect([1,2,3])
m.update()
assert.equal(window.location.search.toString(),"?clone=1,2,3", "url is updated with the multiple clone name");
assert.deepEqual(url.url_dict,{
"clone": "1,2,3"
}, "test url_dict");
m.unselectAll();
assert.equal(window.location.search.toString(),"", "reboot url");
sp.init()
sp.changeSplitMethod("n", "Size", "bar");
sp.update()
assert.equal(window.location.search.toString(),"", "test if plot is in url");
});
QUnit.test("plot : modifyURL",function (assert) {
var m = new Model();
m.parseJsonData(json_data,100)
var sp = new ScatterPlot("visu",m);
sp.init();
var url= new Url(m);
url.init();
// sp.changeSplitMethod("n", "Size", "bar");
sp.changeXaxis()
sp.changeYaxis()
m.update()
assert.deepEqual(url.url_dict,{
"clone": "",
"plot": "gene_v,gene_j,grid"
}, "test plot url_dict")
assert.equal(window.location.search.toString(),"?plot=gene_v,gene_j,grid", "test if plot is in url");
});
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<script type="text/javascript" src='../../js/pdf.js'></script> <script type="text/javascript" src='../../js/pdf.js'></script>
<script type="text/javascript" src='../../js/database.js' data-cover></script> <script type="text/javascript" src='../../js/database.js' data-cover></script>
<script type="text/javascript" src='../../js/tools.js' data-cover></script> <script type="text/javascript" src='../../js/tools.js' data-cover></script>
<script type="text/javascript" src='../../js/url.js' data-cover></script>
<script type="text/javascript" src='../../js/speed_test.js' data-cover></script> <script type="text/javascript" src='../../js/speed_test.js' data-cover></script>
<script type="text/javascript" src="./testFiles/data_test.js"></script> <script type="text/javascript" src="./testFiles/data_test.js"></script>
...@@ -108,6 +109,8 @@ ...@@ -108,6 +109,8 @@
<script src="./testFiles/segmenter_test.js"></script> <script src="./testFiles/segmenter_test.js"></script>
<script src="./testFiles/tools_test.js"></script> <script src="./testFiles/tools_test.js"></script>
<script src="./testFiles/germline_test.js"></script> <script src="./testFiles/germline_test.js"></script>
<script src="./testFiles/model_loader_test.js"></script>
<script src="./testFiles/url_test.js"></script>
<script src="./testFiles/speed_test.js"></script> <script src="./testFiles/speed_test.js"></script>
</body> </body>
</html> </html>
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