{ "version": 3, "sourceRoot": "Source", "sources": ["Website/Client.fs", "Website/Content.fs"], "sourcesContent": ["// $begin{copyright}\n//\n// This file is part of WebSharper\n//\n// Copyright (c) 2008-2018 IntelliFactory\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you\n// may not use this file except in compliance with the License. You may\n// obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n// implied. See the License for the specific language governing\n// permissions and limitations under the License.\n//\n// $end{copyright}\n\n/// Client-side (JavaScript) code.\nmodule WebSharper.Tests.Website.Client\n\nopen WebSharper\nopen WebSharper.JavaScript\nopen WebSharper.Testing\nopen WebSharper.Sitelets.Tests.Client\n\n[]\nlet ClientSideTupleTest (x, y) =\n Runner.RunTests [|\n TestCategory \"ClientSide\" {\n Test \"Passing tuple\" {\n equal x 1\n equal y 2\n }\n }\n |]\n", "// $begin{copyright}\n//\n// This file is part of WebSharper\n//\n// Copyright (c) 2008-2018 IntelliFactory\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you\n// may not use this file except in compliance with the License. You may\n// obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n// implied. See the License for the specific language governing\n// permissions and limitations under the License.\n//\n// $end{copyright}\n\n/// Declares server-side content utilities.\nmodule WebSharper.Tests.Website.Content\n\nopen WebSharper\nopen WebSharper.Sitelets\nopen WebSharper.Sitelets.Tests.Server\nopen WebSharper.Core.Json\n\nmodule PerformanceTests = WebSharper.Sitelets.Tests.PerformanceTests\nmodule SampleSite = WebSharper.Sitelets.Tests.SampleSite\nmodule DateTimeFormatInfer = WebSharper.Sitelets.Tests.DateTimeFormatInfer\n\n[]\ntype FullAction =\n | Site of Actions.Action\n | SiteletsTests of SampleSite.Action\n | CSharpSiteletsTests of obj\n | PerformanceTests of PerformanceTests.Action\n | DateTimeFormatTest of DateTimeFormatInfer.EndPoint\n\nlet HomePage (ctx: Context<_>) =\n Content.Page(\n Title = \"WebSharper tests\",\n Body = [\n Elt(\"h1\", Text \"WebSharper tests\")\n Elt(\"ul\",\n Elt(\"li\",\n Elt(\"a\",\n Attr(\"href\", ctx.Link (Site Actions.Tests)),\n Text \"Client-side test suite\"\n )\n ),\n Elt(\"li\",\n Elt(\"a\",\n Attr(\"href\", ctx.Link (SiteletsTests SampleSite.Home)),\n Text \"Sitelets test minisite\"\n )\n ),\n Elt(\"li\",\n Elt(\"a\",\n Attr(\"href\", ctx.Link (CSharpSiteletsTests \"/\")),\n Text \"C# Sitelets test minisite\"\n )\n ),\n Elt(\"li\",\n Elt(\"a\",\n Attr(\"href\", ctx.Link (CSharpSiteletsTests WebSharper.CSharp.Sitelets.Tests.SiteletTest.JohnDoe)),\n Text \"C# Sitelets test minisite - John Doe\"\n )\n )\n )\n ]\n )\n\nlet TestsPage runServerTests autoStart (ctx: Context) =\n let t12 = (1, 2)\n let jsonBaseUri =\n Tests.Json.String \"\"\n |> ParseRequestResult.Success\n |> SampleSite.Json\n |> SiteletsTests\n |> ctx.Link\n let apiBaseUri =\n Tests.Api.Action.GetPerson 1\n |> SampleSite.Api\n |> SiteletsTests\n |> ctx.Link\n let jsonBaseUri = jsonBaseUri.[..jsonBaseUri.LastIndexOf '/']\n let apiBaseUri = apiBaseUri.[..apiBaseUri.LastIndexOf '/']\n let corsBaseUri =\n System.Configuration.ConfigurationManager.AppSettings.[\"CorsTestUrl\"]\n |> Option.ofObj\n Content.Page(\n Title = \"WebSharper client-side tests\",\n Body = (\n [\n yield ClientSide <@ WebSharper.Tests.Main.RunTests runServerTests autoStart @> :> Web.Control\n yield ClientSide <@ WebSharper.Collections.Tests.Main.RunTests() @> :> Web.Control\n yield WebSharper.CSharp.Tests.InlineControlTest.RunTestsControl runServerTests\n yield ClientSide <@ Client.ClientSideTupleTest t12 @> :> Web.Control\n yield ClientSide <@ WebSharper.Html5.Tests.Main.RunTests() @> :> Web.Control\n yield ClientSide <@ WebSharper.Sitelets.Tests.ClientServerTests.RunTests apiBaseUri corsBaseUri runServerTests @> :> Web.Control\n if runServerTests then\n yield ClientSide <@ WebSharper.Sitelets.Tests.ApiTests.RunTests apiBaseUri @> :> Web.Control\n yield ClientSide <@ WebSharper.Module.Tests.Main.RunTests() @> :> Web.Control\n yield ClientSide <@ WebSharper.Web.Tests.Main.RunTests jsonBaseUri runServerTests @> :> Web.Control\n ] : list\n )\n )\n\nlet MainSite runServerTests ctx = function\n | Actions.Home -> HomePage ctx\n | Actions.Tests -> TestsPage runServerTests true ctx\n | Actions.ConsoleTests -> TestsPage runServerTests false ctx\n\nlet Main runServerTests =\n Sitelet.Sum [\n Sitelet.InferPartialInUnion <@ FullAction.Site @> (MainSite runServerTests)\n Sitelet.Shift \"sitelet-tests\" <|\n Sitelet.EmbedInUnion <@ FullAction.SiteletsTests @> SampleSite.EntireSite\n Sitelet.Shift \"csharp-tests\" <|\n Sitelet.EmbedInUnion <@ FullAction.CSharpSiteletsTests @>\n WebSharper.CSharp.Sitelets.Tests.SiteletTest.Main\n Sitelet.Shift \"perf-tests\" <|\n Sitelet.EmbedInUnion <@ FullAction.PerformanceTests @> PerformanceTests.Site\n Sitelet.Shift \"datetimeformat-test\" <|\n Sitelet.EmbedInUnion <@ FullAction.DateTimeFormatTest @> DateTimeFormatInfer.Site\n ]\n"], "names": [], "mappings": ";;;;;;;;;;;;;;;;S,AA8BI,gBAAgB,EACZ,EAAA;QAAA,wBAAa,YAAY,C,AAAA,M;O,AACrB;;;MAAA,gBAAK,eAAe,C,AAAA,C;I,AAApB,CAAoB,K,AAEhB,CAAS,O,AADT,CAAS,O,AAAT,CAAS,Q,AAAA,C,AAAH;;YAAA,CAAC,C;K,AAAA,C,AAAC;;YAAA,CAAC,C;K,AAAA,C,AAAA,C,AACH;;YAAA,CAAC,C;K,AAAA,C,AAAC;;YAAA,CAAC,C;K,AAAA,C,AAAA,E;I,AACZ;G,AAJoB,yB,AAAA,E,AAM3B,C,AAAA,C;;;;S,AC8D8B,2BAAA,GAA8B,G,AAAA,C,AAA9B,GAA8B,G,AAAA,C,AAAA,C;;;" }