From eb8345e72f64fff042cf4625225ff0f48f67213b Mon Sep 17 00:00:00 2001 From: Andrey Kuzmin Date: Sat, 27 Apr 2019 12:31:48 +0200 Subject: [PATCH] Update tests Signed-off-by: Andrey Kuzmin --- ui/app/tests/Filter.elm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/app/tests/Filter.elm b/ui/app/tests/Filter.elm index db6d09f1..6352657f 100644 --- a/ui/app/tests/Filter.elm +++ b/ui/app/tests/Filter.elm @@ -36,27 +36,31 @@ generateQueryString = [ test "should default silenced & inhibited parameters to false if showSilenced is Nothing" <| \() -> Expect.equal "?silenced=false&inhibited=false" - (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, text = Nothing, showSilenced = Nothing, showInhibited = Nothing }) + (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Nothing, showSilenced = Nothing, showInhibited = Nothing }) , test "should not render keys with Nothing value except the silenced and inhibited parameters" <| \() -> Expect.equal "?silenced=false&inhibited=false" - (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, text = Nothing, showSilenced = Nothing, showInhibited = Nothing }) + (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Nothing, showSilenced = Nothing, showInhibited = Nothing }) , test "should not render filter key with empty value" <| \() -> Expect.equal "?silenced=false&inhibited=false" - (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, text = Just "", showSilenced = Nothing, showInhibited = Nothing }) + (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Just "", showSilenced = Nothing, showInhibited = Nothing }) , test "should render filter key with values" <| \() -> Expect.equal "?silenced=false&inhibited=false&filter=%7Bfoo%3D%22bar%22%2C%20baz%3D~%22quux.*%22%7D" - (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, text = Just "{foo=\"bar\", baz=~\"quux.*\"}", showSilenced = Nothing, showInhibited = Nothing }) + (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Just "{foo=\"bar\", baz=~\"quux.*\"}", showSilenced = Nothing, showInhibited = Nothing }) , test "should render silenced key with bool" <| \() -> Expect.equal "?silenced=true&inhibited=false" - (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, text = Nothing, showSilenced = Just True, showInhibited = Nothing }) + (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Nothing, showSilenced = Just True, showInhibited = Nothing }) , test "should render inhibited key with bool" <| \() -> Expect.equal "?silenced=false&inhibited=true" - (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, text = Nothing, showSilenced = Nothing, showInhibited = Just True }) + (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Nothing, showSilenced = Nothing, showInhibited = Just True }) + , test "should add customGrouping key" <| + \() -> + Expect.equal "?silenced=false&inhibited=false&customGrouping=true" + (Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = True, text = Nothing, showSilenced = Nothing, showInhibited = Nothing }) ]