From fbdea793549a8ccaeea4826f2c81eff444b74ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 2 Sep 2018 16:45:40 +0100 Subject: [PATCH] fix(tests): add test coverage for missed branches in AppBoot --- ui/src/AppBoot.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/src/AppBoot.test.js b/ui/src/AppBoot.test.js index 705301c97..0f390bf58 100644 --- a/ui/src/AppBoot.test.js +++ b/ui/src/AppBoot.test.js @@ -87,4 +87,14 @@ describe("ParseDefaultFilters()", () => { expect(filters).toContain("foo=bar"); expect(filters).toContain("bar=~baz"); }); + + it("returns [] on filters attr that decodes to an object instead of an array", () => { + const filters = FiltersSetting({ foo: "bar" }); + expect(filters).toHaveLength(0); + }); + + it("returns [] on filters attr that decodes to a string instead of an array", () => { + const filters = FiltersSetting("foo=bar"); + expect(filters).toHaveLength(0); + }); });