From 1cd90407704a538b1d9d1df7ed85558eb12824f1 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 15 Jan 2019 21:26:18 +0000 Subject: [PATCH] --- FormCustom/FormCustom.cs | 72 +++++++++++----------------------------- 1 file changed, 20 insertions(+), 52 deletions(-) diff --git a/FormCustom/FormCustom.cs b/FormCustom/FormCustom.cs index d3807bc..77e9cc6 100644 --- a/FormCustom/FormCustom.cs +++ b/FormCustom/FormCustom.cs @@ -92,65 +92,33 @@ namespace raven_integration ((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(25); } - // /// - // /// - // /// - // [Fact] - // public async void InvalidFieldNameShouldFail() - // { - // //CREATE - // dynamic d = new JObject(); - // d.name = Util.Uniquify("Test DataFilter"); - // // d.ownerId = 1L; - // d["public"] = true; - // d.listKey = "widget"; - // //"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}] - // dynamic dfilter = new JArray(); - // dynamic df = new JObject(); - // df.fld = "doesntexist"; - // df.op = "%-"; - // df.value = "Generic";//lots of seed widgets start with Generic - // dfilter.Add(df); - - // d.filter = dfilter.ToString();//it expects it to be a json string, not actual json - - // ApiResponse a = await Util.PostAsync("DataFilter", await Util.GetTokenAsync("BizAdminFull"), d.ToString()); - // Util.ValidateErrorCodeResponse(a, 2200, 400); - // Util.ShouldContainValidationError(a, "Filter", "InvalidValue"); - - // } + /// + /// + /// + [Fact] + public async void AvailableCustomizableFormKeysWorks() + { + ApiResponse a = await Util.GetAsync("FormCustom/AvailableCustomizableFormKeys", await Util.GetTokenAsync("BizAdminFull")); + Util.ValidateDataReturnResponseOk(a); + ((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(0); + } - // /// - // /// - // /// - // [Fact] - // public async void InvalidOperatorShouldFail() - // { - // //CREATE - // dynamic d = new JObject(); - // d.name = Util.Uniquify("Test DataFilter"); - // // d.ownerId = 1L; - // d["public"] = true; - // d.listKey = "widget"; + /// + /// + /// + [Fact] + public async void AvailableCustomTypesWorks() + { + ApiResponse a = await Util.GetAsync("FormCustom/AvailableCustomTypes", await Util.GetTokenAsync("BizAdminFull")); + Util.ValidateDataReturnResponseOk(a); + ((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(4); + } - // //"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}] - // dynamic dfilter = new JArray(); - // dynamic df = new JObject(); - // df.fld = "name"; - // df.op = "wtf"; - // df.value = "Generic";//lots of seed widgets start with Generic - // dfilter.Add(df); - // d.filter = dfilter.ToString();//it expects it to be a json string, not actual json - // ApiResponse a = await Util.PostAsync("DataFilter", await Util.GetTokenAsync("BizAdminFull"), d.ToString()); - // Util.ValidateErrorCodeResponse(a, 2200, 400); - // Util.ShouldContainValidationError(a, "Filter", "InvalidValue"); - - // }