[#42,flot-graph][s]: reinstate configuration of graph from routing info lost in penultimate commit a9cfd4412c.
* view.js: bunch of utility functions for parsing and composing query strings for hash routing (plus tests).
This commit is contained in:
22
test/util.test.js
Normal file
22
test/util.test.js
Normal file
@@ -0,0 +1,22 @@
|
||||
(function ($) {
|
||||
module("Util");
|
||||
|
||||
test('parseHashUrl', function () {
|
||||
var out = recline.View.parseHashUrl('graph?x=y');
|
||||
equal(out.path, 'graph');
|
||||
equal(out.query, '?x=y');
|
||||
var out = recline.View.parseHashUrl('graph');
|
||||
equal(out.path, 'graph');
|
||||
equal(out.query, '');
|
||||
});
|
||||
|
||||
test('composeQueryString', function () {
|
||||
var params = {
|
||||
x: 'y',
|
||||
a: 'b'
|
||||
};
|
||||
var out = recline.View.composeQueryString(params);
|
||||
equal(out, '?x="y"&a="b"');
|
||||
});
|
||||
|
||||
})(this.jQuery);
|
||||
Reference in New Issue
Block a user