[{"name":"Spec","comment":" Functions for writing specs.\n\nA spec is a collection of scenarios, each of which provides an example that\nillustrates a behavior belonging to your program. Each scenario follows\nthe same basic plan:\n\n1. Configure the initial state of the world (and your program).\n2. Perform a sequence of steps.\n3. Check your xpectations about the new state of the world after the steps have been performed.\n\nHere's a sample spec for a browser program called `App`:\n\n    Spec.describe \"some part of my system\"\n    [ Spec.scenario \"the awesome path\" (\n        Spec.given (\n          Spec.Setup.init (App.init testFlags)\n            |> Spec.Setup.withView App.view\n            |> Spec.Setup.withUpdate App.update\n        )\n        |> Spec.when \"something happens\"\n          [ Spec.Markup.target << by [ id \"some-button\" ]\n          , Spec.Markup.Event.click\n          ]\n        |> Spec.it \"does the right thing\" (\n          Spec.Markup.observeElement\n            |> Spec.Markup.query << by [ id \"some-words\" ]\n            |> Spec.expect (Spec.Markup.text <| \n              Spec.Claim.isStringContaining \"something awesome\"\n            )\n        )\n      )\n    ]\n\n# Creating a Spec\n@docs Spec, Scenario, describe, scenario\n\n# Creating the Scenario Script\n@docs Script, given, when\n\n# Turn a Script into a Plan\n@docs Plan, Expectation, it, observeThat, expect\n\n# Tag a Scenario\n@docs tagged\n\n","unions":[{"name":"Expectation","comment":" Represents what should be the case about some part of the world.\n\nExpectations are checked at the end of the scenario, after all steps of the\nscript have been performed.\n","args":["model"],"cases":[]},{"name":"Plan","comment":" Represents the full plan (setup, steps, expectations) involved in a scenario.\n","args":["model","msg"],"cases":[]},{"name":"Scenario","comment":" Represents a particular scenario in a spec.\n","args":["model","msg"],"cases":[]},{"name":"Script","comment":" Represents the setup and steps involved in a scenario.\n","args":["model","msg"],"cases":[]}],"aliases":[{"name":"Spec","comment":" Represents the spec.\n","args":["model","msg"],"type":"Spec.Scenario.Internal.Spec model msg"}],"values":[{"name":"describe","comment":" Specify a description and a list of scenarios that compose the spec.\n","type":"String.String -> List.List (Spec.Scenario model msg) -> Spec.Spec model msg"},{"name":"expect","comment":" Provide an observer with a claim to evaluate.\n","type":"Spec.Claim.Claim a -> Spec.Observer.Observer model a -> Spec.Expectation model"},{"name":"given","comment":" Provide the `Setup` that represents the state of the world at the start of the scenario.\n\nSee `Spec.Setup` for functions to construct this representation.\n","type":"Spec.Setup.Setup model msg -> Spec.Script model msg"},{"name":"it","comment":" Specify an expectation to be checked once the scenario's steps have been performed.\n","type":"String.String -> Spec.Expectation model -> Spec.Script model msg -> Spec.Plan model msg"},{"name":"observeThat","comment":" Specify multiple expectations to be checked once the scenario's steps have been performed.\n","type":"List.List (Spec.Script model msg -> Spec.Plan model msg) -> Spec.Script model msg -> Spec.Plan model msg"},{"name":"scenario","comment":" Create a scenario with a description and a plan.\n","type":"String.String -> Spec.Plan model msg -> Spec.Scenario model msg"},{"name":"tagged","comment":" Associate one or more tags with a scenario.\n\nWhen you run the spec suite with specific tags specified, only the scenarios\ntagged with those tags will be executed.\n","type":"List.List String.String -> Spec.Scenario model msg -> Spec.Scenario model msg"},{"name":"when","comment":" Specify a description and the steps involved in a scenario.\n\nEach step is a function from `Step.Context` to `Step.Command`, but usually\nyou will use steps that are provided by other modules, like `Spec.Markup.Event`.\n\nYou may provide multiple `when` blocks as part of a scenario.\n","type":"String.String -> List.List (Spec.Step.Context model -> Spec.Step.Command msg) -> Spec.Script model msg -> Spec.Script model msg"}],"binops":[]},{"name":"Spec.Claim","comment":" A claim is a function that maps a subject to a verdict.\n\n@docs Claim, Verdict\n\n# Basic Claims\n@docs isEqual, isTrue, isFalse, satisfying\n\n# Claims about Strings\n@docs isStringContaining\n\n# Claims about Lists\n@docs isListWhere, isListWhereItemAt, isListWithLength\n\n# Claims about Maybe types\n@docs isSomething, isSomethingWhere, isNothing\n\n# Working with Claims\n@docs mapRejection\n\n","unions":[{"name":"Verdict","comment":" The result of applying a claim to a subject.\n\nA claim about a subject will either be accepted or rejected.\n","args":[],"cases":[["Accept",[]],["Reject",["Spec.Report.Report"]]]}],"aliases":[{"name":"Claim","comment":" Represents a function from a subject to a verdict.\n","args":["a"],"type":"a -> Spec.Claim.Verdict"}],"values":[{"name":"isEqual","comment":" Claim that the subject is equal to the provided value.\n\nThe first argument to this function converts a value of some type to a string, which\nis used to produce readable messages if the claim is rejected. Instead of providing\nthis string-generating function each time, I suggest adding a helper function that just uses the\n`Debug.toString` function like so:\n\n    equals : a -> Claim a\n    equals =\n      Spec.Claim.isEqual Debug.toString\n\nThen just use your `equals` function whenever you need to claim that a subject is equal to some value.\n","type":"(a -> String.String) -> a -> Spec.Claim.Claim a"},{"name":"isFalse","comment":" Claim that the subject is `False`\n","type":"Spec.Claim.Claim Basics.Bool"},{"name":"isListWhere","comment":" Claim that the subject is a list where the following claims are satisfied:\n\n- the subject has the same length as the provided list\n- for each item in the subject, that item satisfies the corresponding claim in the provided list.\n\nFor example:\n\n    [ 1, 2, 3 ]\n      |> Spec.Claim.isListWhere\n          [ Spec.Claim.isEqualTo Debug.toString 1\n          , Spec.Claim.isEqualTo Debug.toString 27\n          , Spec.Claim.isEqualTo Debug.toString 3\n          ]\n\nwould result in a rejected claim, since 2 is not equal to 27.\n","type":"List.List (Spec.Claim.Claim a) -> Spec.Claim.Claim (List.List a)"},{"name":"isListWhereItemAt","comment":" Claim that the subject is a list such that:\n\n- there is an item at the given index\n- that item satisfies the given claim\n","type":"Basics.Int -> Spec.Claim.Claim a -> Spec.Claim.Claim (List.List a)"},{"name":"isListWithLength","comment":" Claim that the subject is a list with the given length.\n","type":"Basics.Int -> Spec.Claim.Claim (List.List a)"},{"name":"isNothing","comment":" Claim that the subject is the `Nothing` case of the `Maybe` type.\n","type":"Spec.Claim.Claim (Maybe.Maybe a)"},{"name":"isSomething","comment":" Claim that the subject is the `Just` case of the `Maybe` type.\n","type":"Spec.Claim.Claim (Maybe.Maybe a)"},{"name":"isSomethingWhere","comment":" Claim that the subject is the `Just` case of the `Maybe` type and that\nthe associated value satisfies the given claim.\n\nFor example,\n\n    Just \"apple\"\n      |> isSomethingWhere (isStringContaining 1 \"cheese\")\n\nwould be rejected.\n\n","type":"Spec.Claim.Claim a -> Spec.Claim.Claim (Maybe.Maybe a)"},{"name":"isStringContaining","comment":" Claim that the subject contains the given string the given number of times.\n\nFor example,\n\n    \"some funny string\"\n      |> isStringContaining 2 \"fun\"\n\nwould be rejected, since it contains `fun` only once.\n\n","type":"Basics.Int -> String.String -> Spec.Claim.Claim String.String"},{"name":"isTrue","comment":" Claim that the subject is `True`\n","type":"Spec.Claim.Claim Basics.Bool"},{"name":"mapRejection","comment":" Modify the report associated with a rejected verdict; otherwise, do nothing.\n","type":"(Spec.Report.Report -> Spec.Report.Report) -> Spec.Claim.Verdict -> Spec.Claim.Verdict"},{"name":"satisfying","comment":" Combine multiple claims into one.\n\nIf any of the claims is rejected, then the combined claim is rejected.\n","type":"List.List (Spec.Claim.Claim a) -> Spec.Claim.Claim a"}],"binops":[]},{"name":"Spec.Command","comment":" Functions to work with `Cmd` values in a spec.\n\n@docs send, fake\n","unions":[],"aliases":[],"values":[{"name":"fake","comment":" Generate a `Cmd` value that will send a `Msg` to the `update`\nfunction provided in the setup of the scenario.\n","type":"msg -> Platform.Cmd.Cmd msg"},{"name":"send","comment":" A step that sends a command.\n","type":"Platform.Cmd.Cmd msg -> Spec.Step.Context model -> Spec.Step.Command msg"}],"binops":[]},{"name":"Spec.Http","comment":" Observe, and make claims about HTTP requests during a spec.\n\nHere's an example:\n\nFirst, create an `HttpResponseStub` that defines the response to return when a request is sent by the program.\n\n    successStub : HttpResponseStub\n    successStub =\n      Spec.Http.Stub.for (Spec.Http.Route.post \"http://fake-api.com/api/sports\")\n        |> Spec.Http.Stub.withStatus 201\n\nNow, you could write a spec that checks to see if the request body contains a value:\n\n    Spec.describe \"some request\"\n    [ Spec.scenario \"the post is successful\" (\n        Spec.given (\n          Spec.Setup.init (App.init testFlags)\n            |> Spec.Setup.withView App.view\n            |> Spec.Setup.withUpdate App.update\n            |> Spec.Http.Stub.serve [ successStub ]\n        )\n        |> Spec.when \"the request is sent\"\n          [ Spec.Markup.target << by [ id \"request-button\" ]\n          , Spec.Markup.Event.click\n          ]\n        |> Spec.it \"sends the correct request\" (\n          Spec.Http.observeRequests\n              (Spec.Http.Route.post \"http://fake-api.com/api/sports\")\n            |> Spec.expect (Spec.Claim.isListWhere\n              [ Spec.Http.jsonBody\n                  (Json.field \"name\" Json.string)\n                  (Spec.Claim.isEqual Debug.toString \"bowling\")\n              ]\n            )\n        )\n      )\n    ]\n\n# Observe HTTP Requests\n@docs HttpRequest, observeRequests\n\n# Make Claims About HTTP Requests\n@docs url, header, stringBody, jsonBody\n\n","unions":[{"name":"HttpRequest","comment":" Represents an HTTP request made by the program in the course of the scenario.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"header","comment":" Claim that an HTTP request has a header that satisfies the given claim.\n\nFor example, if the observed request has an `Authorization` header with the value\n`Bearer some-fun-token`, then the following claim would be accepted:\n\n    Spec.Http.header \"Authorization\" <|\n      Spec.Claim.isSomethingWhere <|\n      Spec.Claim.isStringContaining 1 \"some-fun-token\"\n\n","type":"String.String -> Spec.Claim.Claim (Maybe.Maybe String.String) -> Spec.Claim.Claim Spec.Http.HttpRequest"},{"name":"jsonBody","comment":" Claim that the body of an HTTP request is a string that can be decoded with the\ngiven decoder into a value that satisfies the given claim.\n\nFor example, if the body of the observed request was `{\"sport\":\"bowling\"}`,\nthen the following claim would be accepted:\n\n    Spec.Http.jsonBody\n      (Json.Decode.field \"sport\" Json.Decode.string)\n      (Spec.Claim.isEqualTo Debug.toString \"bowling\")\n\n","type":"Json.Decode.Decoder a -> Spec.Claim.Claim a -> Spec.Claim.Claim Spec.Http.HttpRequest"},{"name":"observeRequests","comment":" Observe HTTP requests that match the given route.\n\nFor example:\n\n    Spec.Http.observeRequests (Spec.Http.Route.get \"http://fake.com/fake\")\n      |> Spec.expect (Spec.Claim.isListWhere\n        [ Spec.Http.header \"Authorization\" <|\n            Spec.Claim.isSomethingWhere <|\n            Spec.Claim.isStringContaining 1 \"some-fun-token\"\n        ]\n      )\n\n","type":"Spec.Http.Route.HttpRoute -> Spec.Observer.Observer model (List.List Spec.Http.HttpRequest)"},{"name":"stringBody","comment":" Claim that the body of an HTTP request is a string that satisfies the given claim.\n\nNote: If you create a request with `Http.emptyBody` then the given claim will be evaluated\nagainst the empty string.\n","type":"Spec.Claim.Claim String.String -> Spec.Claim.Claim Spec.Http.HttpRequest"},{"name":"url","comment":" Claim that the url of an HTTP request satisfies the given claim.\n\nFor example, you could claim that a request has a particular query parameter like so:\n\n    Spec.Http.observeRequests (Spec.Http.Route.route \"GET\" <| Matching \"fake\\\\.com\")\n      |> Spec.expect (Spec.Claim.isListWhere\n        [ Spec.Http.url\n            Spec.Claim.isStringContaining 1 \"sport=bowling\"\n        ]\n      )\n\nThis claims makes the most sense when observing requests that match a route\ndefined with a regular expression, as in the example above.\n\n","type":"Spec.Claim.Claim String.String -> Spec.Claim.Claim Spec.Http.HttpRequest"}],"binops":[]},{"name":"Spec.Http.Route","comment":" Functions for defining HTTP routes.\n\n@docs HttpRoute\n\n# Define a Route\n@docs get, post, UrlDescriptor, route\n\n# Work with Routes\n@docs encode, toString\n\n","unions":[{"name":"HttpRoute","comment":" Represents an HTTP route.\n","args":[],"cases":[]},{"name":"UrlDescriptor","comment":" Describe a URL when constructing a Route with the `route` function.\n\nUse the `Exact` case when you want to provide a specific string to match against, for example, an absolute URL.\n\nUse the `Matching` case when you want to provide a JavaScript-style regular expression to match against.\n","args":[],"cases":[["Exact",["String.String"]],["Matching",["String.String"]]]}],"aliases":[],"values":[{"name":"encode","comment":" Encode an `HttpRoute` into a JSON object.\n","type":"Spec.Http.Route.HttpRoute -> Json.Encode.Value"},{"name":"get","comment":" Define a GET route with the given URL.\n\n    get \"http://fun.com/fun\"\n\n","type":"String.String -> Spec.Http.Route.HttpRoute"},{"name":"post","comment":" Define a POST route with the given URL.\n\n    post \"http://fun.com/fun\"\n\n","type":"String.String -> Spec.Http.Route.HttpRoute"},{"name":"route","comment":" Define a route with the given method and url descriptor.\n\nFor example, this route describes any request with the\nprotocol `http` and the method `PATCH`:\n\n    Spec.Http.Route.route \"PATCH\" <| Matching \"http:\\\\/\\\\/.*\"\n\n","type":"String.String -> Spec.Http.Route.UrlDescriptor -> Spec.Http.Route.HttpRoute"},{"name":"toString","comment":" Represent an `HttpRoute` as a string.\n","type":"Spec.Http.Route.HttpRoute -> String.String"}],"binops":[]},{"name":"Spec.Http.Stub","comment":" Define and set up stubs for HTTP requests made during a spec.\n\n# Set Up Stubs\n@docs HttpResponseStub, serve\n\n# Define Stubs\n@docs for, withBody, withStatus, withHeader, withNetworkError, withTimeout, abstain\n\n","unions":[{"name":"HttpResponseStub","comment":" Represents the stubbed response for a particular HTTP request.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"abstain","comment":" Abstain from responding to requests to the route defined for the given `HttpResponseStub`.\n\nIt can be useful to abstain from responding if you want to describe the behavior of your\nprogram while waiting for a response.\n","type":"Spec.Http.Stub.HttpResponseStub -> Spec.Http.Stub.HttpResponseStub"},{"name":"for","comment":" Build a stubbed response for requests made to the given route.\n\nBy default, the stubbed response has:\n\n- 200 status code\n- no headers\n- no body\n\n","type":"Spec.Http.Route.HttpRoute -> Spec.Http.Stub.HttpResponseStub"},{"name":"serve","comment":" Set up a fake HTTP server to serve a stubbed response when a matching request is made.\n","type":"List.List Spec.Http.Stub.HttpResponseStub -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"withBody","comment":" Supply a body for the stubbed response.\n","type":"String.String -> Spec.Http.Stub.HttpResponseStub -> Spec.Http.Stub.HttpResponseStub"},{"name":"withHeader","comment":" Supple a header (key, value) for the stubbed response.\n","type":"( String.String, String.String ) -> Spec.Http.Stub.HttpResponseStub -> Spec.Http.Stub.HttpResponseStub"},{"name":"withNetworkError","comment":" Set the stubbed response to trigger a network error.\n","type":"Spec.Http.Stub.HttpResponseStub -> Spec.Http.Stub.HttpResponseStub"},{"name":"withStatus","comment":" Supply a status code for the stubbed response.\n","type":"Basics.Int -> Spec.Http.Stub.HttpResponseStub -> Spec.Http.Stub.HttpResponseStub"},{"name":"withTimeout","comment":" Set the stubbed response to trigger a timeout error.\n","type":"Spec.Http.Stub.HttpResponseStub -> Spec.Http.Stub.HttpResponseStub"}],"binops":[]},{"name":"Spec.Markup","comment":" Target, observe and make claims about aspects of an HTML document.\n\n# Target an HTML Element\n@docs target\n\n# Observe an HTML Document\n@docs MarkupObservation, observeElements, observeElement, query, observeTitle\n\n# Make Claims about an HTML Element\n@docs HtmlElement, text, attribute, property\n\n","unions":[{"name":"HtmlElement","comment":" Represents an HTML element.\n","args":[],"cases":[]},{"name":"MarkupObservation","comment":" Represents an observation of HTML.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"attribute","comment":" Claim that the specified attribute value satisfies the given claim.\n\n    Spec.Markup.observeElement\n      |> Spec.Markup.query << by [ tag \"div\" ]\n      |> Spec.expect (\n        Spec.Markup.attribute \"class\" <|\n          Spec.Claim.isSomethingWhere <|\n          Spec.Claim.isStringContaining 1 \"red\"\n      )\n\nIf you receive an error that the attribute you're interested in is not found, try `Spec.Markup.property`\ninstead. Elm-spec is examining the actual DOM element, and it's not always clear whether Elm uses\nthe attribute or the associated property to configure the element.\n\nOn the difference between attributes and properties,\nsee [this](https://github.com/elm-lang/html/blob/master/properties-vs-attributes.md).\n\n","type":"String.String -> Spec.Claim.Claim (Maybe.Maybe String.String) -> Spec.Claim.Claim Spec.Markup.HtmlElement"},{"name":"observeElement","comment":" Observe an HTML element that matches the selector provided to `Spec.Markup.query`.\n\n    Spec.Markup.observeElement\n      |> Spec.Markup.query << by [ attribute (\"data-attr\", \"some-value\") ]\n      |> Spec.expect (Spec.Markup.text <| \n        Spec.Claim.isEqual Debug.toString \"something fun\"\n      )\n\nClaim that an element is not present in the document like so:\n\n    Spec.Markup.observeElement\n      |> Spec.Markup.query << by [ id \"not-present\" ]\n      |> Spec.expect Spec.Claim.isnNothing\n\n","type":"Spec.Markup.MarkupObservation (Maybe.Maybe Spec.Markup.HtmlElement)"},{"name":"observeElements","comment":" Observe all HTML elements that match the selector provided to `Spec.Markup.query`.\n\n    Spec.Markup.observeElements\n      |> Spec.Markup.query << by [ attribute (\"data-attr\", \"some-value\") ]\n      |> Spec.expect (Spec.Claim.isListWithLength 3)\n\nIf no elements match the query, then the subject of the claim will be an empty list.\n","type":"Spec.Markup.MarkupObservation (List.List Spec.Markup.HtmlElement)"},{"name":"observeTitle","comment":" Observe the title of an HTML document.\n\nNote: It only makes sense to observe the title if your program is constructed with\n`Browser.document` or `Browser.application`.\n","type":"Spec.Observer.Observer model String.String"},{"name":"property","comment":" Apply the given decoder to the HTML element and make a claim about the resulting value.\n\nUse this function to observe a property of an HTML element. For example, you could observe whether\na button is disabled like so:\n\n    Spec.Markup.observeElement\n      |> Spec.Markup.query << by [ tag \"button\" ]\n      |> Spec.expect (\n        Spec.Markup.property\n          (Json.Decode.field \"disabled\" Json.Decode.bool)\n          Spec.Claim.isTrue\n      )\n\nSome common properties one might make claims about:\n\n- `style` => an object\n- `hidden` => a boolean value\n- `checked` => a boolean value\n- `value` (for an input element) => a string\n\nOn the difference between attributes and properties,\nsee [this](https://github.com/elm-lang/html/blob/master/properties-vs-attributes.md).\n\n","type":"Json.Decode.Decoder a -> Spec.Claim.Claim a -> Spec.Claim.Claim Spec.Markup.HtmlElement"},{"name":"query","comment":" Search for HTML elements.\n\nUse this function in conjunction with `observe`, `observeElement`, or `observeElements` to\nobserve the HTML document.\n","type":"( Spec.Markup.Selector.Selector Spec.Markup.Selector.Element, Spec.Markup.MarkupObservation a ) -> Spec.Observer.Observer model a"},{"name":"target","comment":" A step that identifies an element to which later steps will be applied.\n\n    Spec.when \"the button is clicked twice\"\n      [ Spec.Markup.target << by [ tag \"button\" ]\n      , Spec.Markup.Event.click\n      , Spec.Markup.Event.click\n      ]\n\n","type":"( Spec.Markup.Selector.Selector a, Spec.Step.Context model ) -> Spec.Step.Command msg"},{"name":"text","comment":" Claim that the HTML element's text satisfies the given claim.\n\n    Spec.Markup.observeElement\n      |> Spec.Markup.query << by [ tag \"div\" ]\n      |> Spec.expect (\n        Spec.Markup.text <|\n          Spec.Claim.isStringContaining 1 \"red\"\n      )\n\nNote that an observed HTML element's text includes the text belonging to\nall its descendants.\n","type":"Spec.Claim.Claim String.String -> Spec.Claim.Claim Spec.Markup.HtmlElement"}],"binops":[]},{"name":"Spec.Markup.Event","comment":" Use these steps to trigger events during a scenario.\n\nTo trigger an event, you'll want to first use `Spec.Markup.target` to target a\nparticular element (or the document as a whole) to which subsequent events should apply.\n\nFor example,\n\n    Spec.describe \"a form\"\n    [ Spec.scenario \"completing the form\" (\n        Spec.given (\n          testSubject\n        )\n        |> when \"the form is revealed\"\n          [ Spec.Markup.target << by [ id \"show-form\" ]\n          , Spec.Markup.Event.click\n          ]\n        |> when \"the name is entered\"\n          [ Spec.Markup.target << by [ id \"first-name-field\" ]\n          , Spec.Markup.Event.input \"Brian\"\n          , Spec.Markup.target << by [ id \"last-name-field\" ]\n          , Spec.Markup.Event.input \"Watkins\"\n          ]\n        |> when \"the form is submitted\"\n          [ Spec.Markup.target << by [ id \"submit\" ]\n          , Spec.Markup.Event.click\n          ]\n        |> it \"does something cool\" (\n          ...\n        )\n      )\n    ]\n\n# Mouse Events\n@docs click, doubleClick, mouseDown, mouseUp, mouseMoveIn, mouseMoveOut\n\n# Form Events\n@docs input, selectOption\n\n# Window Events\n@docs resizeWindow, hideWindow, showWindow\n\n# Focus Events\n@docs focus, blur\n\n# Custom Events\n@docs trigger\n\n","unions":[],"aliases":[],"values":[{"name":"blur","comment":" A step that simulates the targeted HTML element losing focus.\n\nThis will trigger a `blur` DOM event on the targeted element.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"click","comment":" A step that simulates a click event on the targeted item, either the\ndocument as a whole (using the `Spec.Markup.Selector.document` selector or\nsome particular HTML element).\n\nThis will trigger `mousedown`, `mouseup`, and `click` DOM events on the targeted item.\n\nIn several cases, you can use `click` to trigger other kinds of events. Use `click` to\nsimulate checking or unchecking a checkbox. Use `click` to select a radio button. Use\n`click` to submit a form by clicking the associated button.\n\nYou can also use `click` on an anchor tag, but here the behavior is a\nlittle more complicated.\n\nFirst of all, any click event handlers associated with the anchor tag will\nbe triggered as expected.\n\nIf the anchor tag has an `href` attribute, then\nelm-spec can *usually* intercept the navigation, which allows you to use `Spec.Navigation.observeLocation`\nto make a claim about the location to which you've navigated. Elm-spec will simulate going to another\npage by replacing the program's view with a page that states the program has navigated\noutside the Elm context.\n\nIf the anchor tag has an `href` attribute *and* a `target` attribute or a `download` attribute\nthen elm-spec will *not* intercept the navigation. This means that the navigation will\nproceed as if the program were actually running, and this will usually cause your\nspecs to get into a bad state. So, rather than clicking such a link during a scenario, you\nshould instead just observe that it has the `href` attribute you expect.\n\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"doubleClick","comment":" A step that simulates a double click on the targeted HTML element.\n\nThis will trigger two sets of `mouseup`, `mousedown`, and `click` DOM events and then a `dblclick` DOM event.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"focus","comment":" A step that simulates the targeted HTML element receiving focus.\n\nThis will trigger a `focus` DOM event on the targeted element.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"hideWindow","comment":" A step that simulates hiding the window from view.\n\nThis will trigger a `visibilitychange` DOM event on the document object.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"input","comment":" A step that simulates text input to the targeted HTML element.\n\nThis will set the `value` attribute of the targeted element to the given string\nand trigger an `input` DOM event on that element.\n\nTo trigger input events on a radio button just target the button and simulate a click on it.\n\nTo trigger input events on a select, use `selectOption`.\n","type":"String.String -> Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"mouseDown","comment":" A step that simulates pressing the mouse button on the targeted item, either the\ndocument as a whole (using the `Spec.Markup.Selector.document` selector or\nsome particular HTML element).\n\nThis will trigger a `mouseDown` DOM event on the targeted item.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"mouseMoveIn","comment":" A step that simulates the mouse moving into the targeted HTML element.\n\nThis will trigger `mouseover` and `mouseenter` DOM events on the targeted element.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"mouseMoveOut","comment":" A step that simulates the mouse moving out of the targeted HTML element.\n\nThis will trigger `mouseout` and `mouseleave` DOM events on the targeted element.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"mouseUp","comment":" A step that simulates releasing the mouse button on the targeted item, either the\ndocument as a whole (using the `Spec.Markup.Selector.document` selector or\nsome particular HTML element).\n\nThis will trigger a `mouseup` DOM event on the targeted item.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"resizeWindow","comment":" A step that simulates resizing the browser window to the given (width, height).\n\nThis will trigger a `resize` DOM event on the window object.\n","type":"( Basics.Int, Basics.Int ) -> Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"selectOption","comment":" A step that simulates selecting an option from the menu generated by a `<select>` element.\n\nThis will select the option whose text or label matches the given string, and then trigger `change` and\n`input` DOM events on the targeted HTML `<select>` element.\n","type":"String.String -> Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"showWindow","comment":" A step that simulates the window returning into view.\n\nThis will trigger a `visibilitychange` DOM event on the document object.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"trigger","comment":" A step that triggers a custom DOM event on the targeted item.\n\nProvide the name of the DOM event and a JSON value that specifes any properties to add to the event object.\n\nFor example, to simulate releasing the `A` key:\n\n    Spec.when \"The A key is released\"\n      [ Spec.Markup.target << by [ id \"my-field\" ]\n      , Json.Encode.object [ ( \"keyCode\", Encode.int 65 ) ]\n          |> Spec.Markup.event.trigger \"keyup\"\n      ]\n\nYou may trigger a custom DOM event on the document (by selecting it with `Spec.Markup.Selector.document`)\nor some particular HTML element.\n\n","type":"String.String -> Json.Encode.Value -> Spec.Step.Context model -> Spec.Step.Command msg"}],"binops":[]},{"name":"Spec.Markup.Navigation","comment":" Functions for observing navigation changes.\n\n@docs observeLocation, expectReload\n\n","unions":[],"aliases":[],"values":[{"name":"expectReload","comment":" Expect that a `Browser.Navigation.reload` or `Browser.Navigation.reloadAndSkipCache`\ncommand was executed.\n","type":"Spec.Expectation model"},{"name":"observeLocation","comment":" Observe the current location of the document.\n\n    Spec.it \"has the correct location\" (\n      observeLocation\n        |> Spec.expect (\n           Spec.Claim.isEqual Debug.toString\n             \"http://fake-server.com/something-fun\"\n        )\n    )\n\nThis is useful to observe that `Browswer.Navigation.load`,\n`Browser.Navigation.pushUrl`, or `Browser.Navigation.replaceUrl` was\nexecuted with the value you expect.\n\nNote that you can use `Spec.Setup.withLocation` to set the base location\nof the document at the start of the scenario.\n\n","type":"Spec.Observer.Observer model String.String"}],"binops":[]},{"name":"Spec.Markup.Selector","comment":" Build abstract descriptions that can be used to select aspects of an HTML document.\n\n# Build Selectors\n@docs Selector, Element, by, descendantsOf, Object, document, toString\n\n# Define Characteristics\n@docs Characteristic, id, tag, class, attribute, attributeName\n\n","unions":[{"name":"Characteristic","comment":" A selector is built from one or more characteristics. \n","args":[],"cases":[]},{"name":"Element","comment":" A kind of selector that pertains only to HTML elements.\n","args":[],"cases":[]},{"name":"Object","comment":" A kind of selector that pertains only to a specific item.\n","args":[],"cases":[]},{"name":"Selector","comment":" An abstract description of some aspect of an HTML document, usually an HTML element.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"attribute","comment":" Generate a characteristic that belongs to elements with the given (name, value) pair.\n\nFor example,\n\n    attribute ( \"data-some-attr\", \"some-value\" )\n\napplies to elements having an attribute named `data-some-attr` with the value `some-value`.\n\n","type":"( String.String, String.String ) -> Spec.Markup.Selector.Characteristic"},{"name":"attributeName","comment":" Generate a characteristic that belongs to elements with the given attribute.\n\nFor example, \n\n    attributeName \"data-some-attr\"\n\napplies to elements having an attribute names `data-some-attr`.\n\n","type":"String.String -> Spec.Markup.Selector.Characteristic"},{"name":"by","comment":" Generate a selector that matches HTML elements with the given characteristics.\n","type":"List.List Spec.Markup.Selector.Characteristic -> a -> ( Spec.Markup.Selector.Selector Spec.Markup.Selector.Element, a )"},{"name":"class","comment":" Generate a characteristic that belongs to elements with the given CSS class.\n\nFor example,\n\n    class \"fun-class\"\n\napplies to elements to which the CSS class `fun-class` has been applied.\n\n","type":"String.String -> Spec.Markup.Selector.Characteristic"},{"name":"descendantsOf","comment":" Generate a selector that matches HTML elements descending from any HTML elements with the\ngiven characteristics.\n\nFor example,\n\n    descendantsOf [ tag \"div\" ] << by [ tag \"span\" ]\n\nwill match all `<span>` that are inside a `<div>`. You may chain `descendantsOf` selectors\nusing `<<` but the chain must terminate with a `by` selector.\n\n","type":"List.List Spec.Markup.Selector.Characteristic -> ( Spec.Markup.Selector.Selector Spec.Markup.Selector.Element, a ) -> ( Spec.Markup.Selector.Selector Spec.Markup.Selector.Element, a )"},{"name":"document","comment":" Generate a selector that matches the HTML document.\n\nThis is used primarily in conjunction with `Spec.Markup.target` to trigger\ndocument-level events.\n\nFor example,\n\n    Spec.when \"a document level mouse click is triggered\"\n      [ Spec.Markup.target << document\n      , Spec.Markup.Event.click\n      ]\n\nThe `document` selector only works with `Spec.Markup.target`, which is to say\nthat you cannot observe the document to make claims about it.\n\n","type":"Spec.Step.Context model -> ( Spec.Markup.Selector.Selector Spec.Markup.Selector.Object, Spec.Step.Context model )"},{"name":"id","comment":" Generate a characteristic that belongs to elements having\nan `id` attribute with the given value.\n","type":"String.String -> Spec.Markup.Selector.Characteristic"},{"name":"tag","comment":" Generate a characteristic that belongs to elements having the given tag name.\n\nFor example,\n\n    tag \"div\"\n\napplies to HTML `<div>` elements.\n\n","type":"String.String -> Spec.Markup.Selector.Characteristic"},{"name":"toString","comment":" Convert a Selector to a string.\n\nFor those selectors of type `Selector Element`, the resulting string will be in\nthe style of a CSS selector.\n","type":"Spec.Markup.Selector.Selector a -> String.String"}],"binops":[]},{"name":"Spec.Observer","comment":" An observer examines some part of the world so a claim can be made about it.\n\nThis module contains functions for working with observers at a high level.\n\nCheck out `Spec.Markup`, `Spec.Http`, `Spec.Port`, and `Spec.Witness` for\nmore observers.\n\n# Build Observers\n@docs Observer, observeModel\n\n# Work with Observers\n@docs observeResult, mapRejection, focus\n\n","unions":[],"aliases":[{"name":"Observer","comment":" An `Observer` examines some particular part of the world so that a\nclaim can be evaluated with respect to it.\n","args":["model","a"],"type":"Spec.Observer.Internal.Observer model a"}],"values":[{"name":"focus","comment":" Create a new `Observer` that evaluates a claim with respect to a particular aspect of the world\nobserved by the given observer.\n\nConsider an `Observer model (Maybe HtmlElement)`, which observes all aspects of a `Maybe HtmlElement`.\nCreate an `Observer` that focuses on just the text of an existing `HtmlElement` like so:\n\n    Spec.Markup.observeElement\n      |> Spec.Markup.query << by [ id \"some-element\" ]\n      |> focus Spec.Claim.isSomethingWhere\n      |> focus Spec.Markup.text\n      |> Spec.expect (equals \"Something cool!\")\n\nIf the element doesn't exist, then the `isSomethingWhere` claim would fail, and subsequent claims would not be evaluated by the observer.\n\nYou could then abstract this into a helper function like so:\n\n    expectText : Claim String -> Observer model (Maybe HtmlElement) -> Expectation model\n    expectText claim observer =\n      observer\n        |> focus Spec.Claim.isSomethingWhere\n        |> focus Spec.Markup.text\n        |> Spec.expect claim\n\nAnd then you could write:\n\n    Spec.Markup.observeElement\n      |> Spec.Markup.query << by [ id \"some-element\" ]\n      |> expectText (equals \"Something cool!\")\n\n","type":"(Spec.Claim.Claim b -> Spec.Claim.Claim a) -> Spec.Observer.Observer model a -> Spec.Observer.Observer model b"},{"name":"mapRejection","comment":" Create a new `Observer` that will map the `Report` created if the `Claim` is rejected.\n","type":"(Spec.Report.Report -> Spec.Report.Report) -> Spec.Observer.Observer model a -> Spec.Observer.Observer model a"},{"name":"observeModel","comment":" Observe some aspect of the model of the program whose behavior is being described in this scenario.\n\nFor example, if the program model looks like `{ score: 27 }`, then you could observe the\nscore like so:\n\n    Spec.it \"has the correct score\" (\n      observeModel .score\n        |> Spec.expect \n          (Spec.Claim.isEqual Debug.toString 27)\n    )\n\nCheck out `Spec.Markup`, `Spec.Http`, `Spec.Port`, and `Spec.Witness` for\nobservers that evaluate claims with respect to the world outside the program.\n\n","type":"(model -> a) -> Spec.Observer.Observer model a"},{"name":"observeResult","comment":" Create a new `Observer` that will evaluate a `Claim` with respect to\nthe successful `Result` observed by the given `Observer`. If the `Result`\nfails then the `Claim` will be rejected.\n","type":"Spec.Observer.Observer model (Result.Result Spec.Report.Report a) -> Spec.Observer.Observer model a"}],"binops":[]},{"name":"Spec.Port","comment":" Functions for working with ports during a spec.\n\nSuppose your app sends a port command when a button is clicked,\nvia a function called `my-command-port` that takes a string (\"TRIGGER_REQUEST\" in\nthis case), and then displays a message received over a port subscription. You\ncould write a scenario like so:\n\n    Spec.describe \"command ports and subscription ports\"\n    [ Spec.scenario \"send and receive\" (\n        Spec.given (\n          Spec.Setup.withInit (App.init testFlags)\n            |> Spec.Setup.withUpdate App.update\n            |> Spec.Setup.withView App.view\n            |> Spec.Setup.withSubscriptions App.subscriptions\n        )\n        |> Spec.when \"a message is sent out\"\n          [ Spec.Markup.target << by [ tag \"button\" ]\n          , Spec.Markup.Event.click\n          ]\n        |> Spec.when \"a response is received\"\n          [ Spec.Port.send \"my-subscription-port\" <|\n              Json.Encode.object\n                [ (\"message\", Encode.string \"Have fun!\")\n                ]\n          ]\n        |> Spec.observeThat\n          [ Spec.it \"sent the right message over the port\" (\n              Spec.Port.observe \"my-command-port\" Json.Decode.string\n                |> Spec.expect (Spec.Claim.isListWhere\n                  [ Spec.Claim.isEqual Debug.toString \"TRIGGER_REQUEST\"\n                  ]\n                )\n            )\n          , Spec.it \"shows the message received\" (\n              Spec.Markup.observeElement\n                |> Spec.Markup.query << by [ id \"message\" ]\n                |> Spec.expect (Spec.Markup.text <| equals \"Have fun!\")\n            )\n          ]\n      )\n    ]\n\n# Observe Command Ports\n@docs observe\n\n# Simulate Subscription Ports\n@docs send\n\n","unions":[],"aliases":[],"values":[{"name":"observe","comment":" Observe messages sent out via a command port.\n\nProvide the name of the port (the function name) and a decoder that can decode\nmessages sent out over the port.\n\n","type":"String.String -> Json.Decode.Decoder a -> Spec.Observer.Observer model (List.List a)"},{"name":"send","comment":" A step that sends a message to a port subscription.\n\nProvide the name of the port and an encoded JSON value that should be sent from the JavaScript side.\n\nFor example, if you have a port defined in Elm like so:\n\n    port listenForStuff : (String -> msg) -> Sub msg\n\nThen you could send a message through this port during a scenario like so:\n\n    Spec.when \"a message is sent to the subscription\"\n    [ Encode.string \"Some words\"\n        |> Spec.Port.send \"listenForStuff\"\n    ]\n\n","type":"String.String -> Json.Encode.Value -> Spec.Step.Context model -> Spec.Step.Command msg"}],"binops":[]},{"name":"Spec.Report","comment":" Functions for building reports that are displayed by the elm-spec JavaScript runner.\n\n# Build a Report\n@docs Report, note, fact, batch\n\n# Convert to and from JSON\n@docs decoder, encode\n","unions":[{"name":"Report","comment":" Represents a collection of notes or facts.\n\nFor example, a `Report` can describe why a `Claim` was rejected.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"batch","comment":" Combine a list of reports into one.\n","type":"List.List Spec.Report.Report -> Spec.Report.Report"},{"name":"decoder","comment":" Decode a `Report` from an appropriate JSON object.\n","type":"Json.Decode.Decoder Spec.Report.Report"},{"name":"encode","comment":" Encode a `Report` into a JSON object.\n","type":"Spec.Report.Report -> Json.Encode.Value"},{"name":"fact","comment":" Generate a `Report` that is a line of text followed by some details that should be emphasized.\n","type":"String.String -> String.String -> Spec.Report.Report"},{"name":"note","comment":" Generate a `Report` that is a single line of text.\n","type":"String.String -> Spec.Report.Report"}],"binops":[]},{"name":"Spec.Runner","comment":" Use these functions and types to create the program that will run the spec suite.\n\n# Create a Spec Suite Program\n@docs Config, browserProgram, program\n\n# Spec Suite Program Types\n@docs Message, Flags, Msg, Model\n\n","unions":[],"aliases":[{"name":"Config","comment":" The spec suite runner must provide a Config, which must be implemented as follows:\n\nCreate two ports:\n\n    port elmSpecOut : Message -> Cmd msg\n    port elmSpecIn : (Message -> msg) -> Sub msg\n\nAnd then create a `Config` like so:\n\n    config : Spec.Runner.Config msg\n    config =\n      { send = elmSpecOut\n      , outlet = elmSpecOut\n      , listen = elmSpecIn\n      }\n\nThe `send` and `outlet` attributes must reference the same port, `elmSpecOut`.\n\n","args":["msg"],"type":"{ send : Spec.Runner.Message -> Platform.Cmd.Cmd (Spec.Runner.Msg msg), outlet : Spec.Runner.Message -> Platform.Cmd.Cmd msg, listen : (Spec.Runner.Message -> Spec.Runner.Msg msg) -> Platform.Sub.Sub (Spec.Runner.Msg msg) }"},{"name":"Flags","comment":" Flags that the JavaScript runner will pass to the spec suite program.\n","args":[],"type":"Spec.Program.Flags"},{"name":"Message","comment":" Represents a message to pass between elm-spec and the JavaScript elm-spec runner.\n","args":[],"type":"Spec.Message.Message"},{"name":"Model","comment":" Used by the spec suite program.\n","args":["model","msg"],"type":"Spec.Program.Model model msg"},{"name":"Msg","comment":" Used by the spec suite program.\n","args":["msg"],"type":"Spec.Program.Msg msg"}],"values":[{"name":"browserProgram","comment":" Create a spec suite program for describing the behavior of browser-based programs.\n\nOnce you've created the `Config` value in your `Runner` module, I suggest adding a function like so:\n\n    program : List (Spec model msg) -> Program Flags (Model model msg) (Msg msg)\n    program =\n      Spec.Runner.browserProgram config\n\nThen, each of your spec modules can implement their own `main` function:\n\n    main =\n      Runner.program\n        [ ... some specs ...\n        ]\n\nThe JavaScript runner will find each spec module and run it as its own program.\n\n","type":"Spec.Runner.Config msg -> List.List (Spec.Spec model msg) -> Platform.Program Spec.Runner.Flags (Spec.Runner.Model model msg) (Spec.Runner.Msg msg)"},{"name":"program","comment":" Create a spec suite program for describing the behavior of headless programs.\n\nOnce you've created the `Config` value in your `Runner` module, I suggest adding a function like so:\n\n    program : List (Spec model msg) -> Program Flags (Model model msg) (Msg msg)\n    program =\n      Spec.Runner.program config\n\nThen, each of your spec modules can implement their own `main` function:\n\n    main =\n      Runner.program\n        [ ... some specs ...\n        ]\n\nThe JavaScript runner will find each spec module and run it as its own program.\n\n","type":"Spec.Runner.Config msg -> List.List (Spec.Spec model msg) -> Platform.Program Spec.Runner.Flags (Spec.Runner.Model model msg) (Spec.Runner.Msg msg)"}],"binops":[]},{"name":"Spec.Setup","comment":" Functions for the initial setup of a scenario.\n\n@docs Setup\n\n# Setup the Initial State\n@docs initForApplication, init, initWithModel, withLocation\n\n# Provide Core Functions\n@docs withUpdate, withView, withDocument, withSubscriptions, forNavigation\n\n","unions":[],"aliases":[{"name":"Setup","comment":" Represents the initial state of the world for a scenario.\n","args":["model","msg"],"type":"Spec.Setup.Internal.Setup model msg"}],"values":[{"name":"forNavigation","comment":" If the scenario is describing a program created with `Browser.application`, you can use\nthis function to supply the program's `onUrlRequest` and `onUrlChange` functions.\n\nUse this in conjunction with `initForApplication` to describe a scenario that involves location changes.\n","type":"{ onUrlRequest : Browser.UrlRequest -> msg, onUrlChange : Url.Url -> msg } -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"init","comment":" Provide an initial program model and command. The command will be executed as\nthe first step in the scenario script.\n\nYou might use `init` in conjunction with the `init` function of the program whose\nbehavior the scenario describes. In that case you could do something like:\n\n    Spec.given (\n      Spec.Setup.init (App.init testFlags)\n        |> Spec.Setup.withUpdate App.update\n        |> Spec.Setup.withView App.view\n    )\n\nIf you are describing the behavior of a program created with `Browser.application` then\nconsider using `initForApplication` instead.\n\n","type":"( model, Platform.Cmd.Cmd msg ) -> Spec.Setup.Setup model msg"},{"name":"initForApplication","comment":" Use the init function for a program created with `Browser.application` to set the\ninitial state for the scenario. You could do something like:\n\n    Spec.given (\n      Spec.Setup.initForApplication (App.init testFlags)\n        |> Spec.Setup.withDocument App.view\n        |> Spec.Setup.withUpdate App.update\n    )\n\nIf your scenario involves location changes, you'll want to use this function in\nconjunction with `Spec.Setup.forNavigation` to provide\nthose extra functions that an application requires. Providing these functions\nis not necessary, but if you do not provde them, your spec will fail with an error\nif it is setup with `initForApplication` and it tries to make location changes.\n\nYou can also use `Spec.Setup.withLocation` to set the URL that\nwill be passed to the application's init function at the start of the scenario.\n\nSo, a full setup for an application might look something like this:\n\n    Spec.given (\n      Spec.Setup.initForApplication (App.init testFlags)\n        |> Spec.Setup.withDocument App.view\n        |> Spec.Setup.withUpdate App.update\n        |> Spec.Setup.forNavigation\n          { onUrlChange = App.urlDidChange\n          , onUrlRequest = App.urlChangeRequested\n          }\n        |> Spec.Setup.withLocation (someUrlWithPath \"/sports\")\n    )\n\n","type":"(Url.Url -> Browser.Navigation.Key -> ( model, Platform.Cmd.Cmd msg )) -> Spec.Setup.Setup model msg"},{"name":"initWithModel","comment":" Provide an initial model for the program whose behavior this scenario describes.\n","type":"model -> Spec.Setup.Setup model msg"},{"name":"withDocument","comment":" Provide the `view` function for the program whose behavior the scenario describes, where\nthis program is created with `Browser.document` or `Browser.application`. \n","type":"(model -> Browser.Document msg) -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"withLocation","comment":" Set up the scenario to begin with a particular location.\n\nIf the program whose behavior is being described was created with `Browser.application` then\nthis `Url` will be provided to the `init` function. In any case, this location will serve as\nthe base href, and any location changes will be relative to this location.\n\nBy default, the scenario begins with the location `http://elm-spec/`\n","type":"Url.Url -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"withSubscriptions","comment":" Provide the `subscriptions` function for the program whose behavior the scenario describes.\n","type":"(model -> Platform.Sub.Sub msg) -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"withUpdate","comment":" Provide the `update` function for the program whose behavior the scenario describes.\n","type":"(msg -> model -> ( model, Platform.Cmd.Cmd msg )) -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"withView","comment":" Provide the `view` function for the program whose behavior the scenario describes, where\nthis program is created with `Browser.sandbox` or `Browser.element`.\n","type":"(model -> Html.Html msg) -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"}],"binops":[]},{"name":"Spec.Step","comment":" A scenario script is a sequence of steps. A step is a function from a `Context`,\nwhich represents the current scenario state, to a `Command`, which describes an action to be\nexecuted before moving to the next step.\n\nSee `Spec.Command`, `Spec.Markup`, `Spec.Markup.Event`, `Spec.Port`, and `Spec.Time` for\nsteps you can use to build a scenario script.\n\n@docs Context, Command\n\n# Using the Context\n@docs model\n\n","unions":[],"aliases":[{"name":"Command","comment":" Represents an action to be performed.\n","args":["msg"],"type":"Spec.Step.Command.Command msg"},{"name":"Context","comment":" Represents the current state of the program.\n","args":["model"],"type":"Spec.Step.Context.Context model"}],"values":[{"name":"model","comment":" Get the current program model from the `Context`.\n","type":"Spec.Step.Context model -> model"}],"binops":[]},{"name":"Spec.Time","comment":" Functions for working with time during a spec.\n\nSuppose you use `Time.every` to increment a count in your model after each second.\nHere's a spec you could use to describe that behavior:\n\n    Spec.describe \"seconds counter\"\n    [ Spec.scenario \"some seconds pass\" (\n        Spec.given (\n          Spec.Setup.init (App.init testFlags)\n            |> Spec.Setup.withView App.view\n            |> Spec.Setup.withUpdate App.update\n        )\n        |> when \"some time passes\"\n          [ Spec.Time.tick 3000\n          ]\n        |> it \"increments the counter\" (\n          Spec.Observer.observeModel .seconds\n            |> Spec.expect (Spec.Claim.isEqual Debug.toString 3)\n        )\n      )\n    ]\n\n# Set Up at a Time\n@docs withTime, withTimezoneOffset\n\n# Pass the Time\n@docs tick, nextAnimationFrame\n\n","unions":[],"aliases":[],"values":[{"name":"nextAnimationFrame","comment":" A step that simulates waiting for the next animation frame.\n\nAny subscriptions that depend on animation frame updates will be triggered as expected.\n","type":"Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"tick","comment":" A step that simulates waiting for some number of milliseconds to pass.\n\nAny subscriptions that depend on the passage of time will be triggered as expected.\n","type":"Basics.Int -> Spec.Step.Context model -> Spec.Step.Command msg"},{"name":"withTime","comment":" Set up the scenario at a particular time.\n\nProvide the number of milliseconds since the UNIX epoch.\n","type":"Basics.Int -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"withTimezoneOffset","comment":" Set up the scenario at a particular timezone offset.\n\nProvide the timezone offste in minutes.\n","type":"Basics.Int -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"}],"binops":[]},{"name":"Spec.Witness","comment":" A `Witness` can be used to record information about the arguments passed to\na `Cmd`-generating function.\n\nIf you use dependency inversion to decouple part of your program from the\n`Cmd`-generating functions it depends upon, you can use a `Witness` to prove that this\npart of your program works with the `Cmd`-generating function in the right way.\n\nLet's say I have a `Cmd`-generating function that takes a score (an `Int`) and saves\nit to the server via some HTTP request. Let's further suppose I want to describe the behavior\nof my user interface, without worrying about the details of how a score is saved. In this\ncase, I'll 'inject' the `Cmd`-generating function instead of calling it directly from my update\nfunction. This allows me to substitute a fake function during my spec.\n\nHere's the update function:\n\n    update : (Int -> Cmd Msg) -> Msg -> Model -> (Model, Cmd Msg)\n    update scoreSaver msg model =\n      case msg of\n        SaveScore score ->\n          ( model, scoreSaver score )\n        ...\n\nNow, I can write a spec that uses a witness to record the score passed to the injected\n`scoreSaver` function like so:\n\n    Spec.describe \"saving the score\"\n    [ Spec.scenario \"successful save\" (\n        Spec.given (\n          Spec.Setup.init (App.init testFlags)\n            |> Spec.Setup.withView App.view\n            |> Witness.forUpdate (\\witness ->\n              App.update <| \\score ->\n                Witness.log \"saved-score\"\n                  (Json.Encode.int score) witness\n            )\n        )\n        |> Spec.when \"the score is saved\"\n          [ Spec.Markup.target << by [ id \"game-over-button\" ]\n          , Spec.Markup.Event.click\n          ]\n        |> it \"saves the proper score\" (\n          Witness.observe \"saved-score\" (Json.Decode.int)\n            |> Spec.expect (Spec.Claim.isList\n              [ Spec.Claim.isEqual Debug.toString 28\n              ]\n            )\n        )\n      )\n    ]\n\n@docs Witness, forUpdate, log, observe\n\n","unions":[{"name":"Witness","comment":" Use a `Witness` to record information from inside a `Cmd`-generating function.\n","args":["msg"],"cases":[]}],"aliases":[],"values":[{"name":"forUpdate","comment":" Set up the scenario with the update function from the program whose behavior is being\ndescribed. You'll have access to a `Witness` to use in constructing this function.\n\nSee the example above.\n","type":"(Spec.Witness.Witness msg -> msg -> model -> ( model, Platform.Cmd.Cmd msg )) -> Spec.Setup.Setup model msg -> Spec.Setup.Setup model msg"},{"name":"log","comment":" Create a `Cmd` that logs some information.\n\nProvide the name of this witness and a JSON value with any information to be logged.\n","type":"String.String -> Json.Encode.Value -> Spec.Witness.Witness msg -> Platform.Cmd.Cmd msg"},{"name":"observe","comment":" Observe the logs recorded by a witness.\n\nProvide the name of the witness and a JSON decoder that can decode whatever\nvalue you need to observe.\n","type":"String.String -> Json.Decode.Decoder a -> Spec.Observer.Observer model (List.List a)"}],"binops":[]}]