From fe75b4c6f013e4457b683431f493852bdf5ba917 Mon Sep 17 00:00:00 2001 From: Richard Eames Date: Thu, 11 Jun 2015 16:15:44 -0600 Subject: [PATCH] Update mithril-tests.js Added tests for parsing empty string, and building from empty object. This is the test case for #660 --- tests/mithril-tests.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index 041b5331..8dc1f383 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -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")