Update mithril-tests.js

Added tests for parsing empty string, and building from empty object.
This is the test case for #660
This commit is contained in:
Richard Eames 2015-06-11 16:15:44 -06:00
parent 143b7ae3a6
commit fe75b4c6f0

View file

@ -3832,7 +3832,10 @@ function testMithril(mock) {
var args = m.route.parseQueryString("foo=bar&hello=world&hello=mars&bam=&yup")
return args.foo === "bar" && args.hello[0] === "world" && args.hello[1] === "mars" && args.bam === "" && args.yup === null
})
test(function() {
var args = m.route.parseQueryString("")
return Object.keys(args).length === 0
})
//m.route.buildQueryString
test(function() {
var string = m.route.buildQueryString({
@ -3847,7 +3850,10 @@ function testMithril(mock) {
})
return string === "foo=bar&hello=world&hello=mars&world%5Btest%5D=3&bam=&yup"
})
test(function() {
var string = m.route.buildQueryString({});
return string === ""
})
//m.prop
test(function() {
var prop = m.prop("test")