brian-watkins/elm-spec/1.1.0

NOTE: the latest version is 3.3.2

Spec.Markup.Navigation

Functions for observing navigation changes.

observeLocation : Observer model String

Observe the current location of the document.

Spec.it "has the correct location" (
  observeLocation
    |> Spec.expect (
       Spec.Claim.isEqual Debug.toString
         "http://fake-server.com/something-fun"
    )
)

This is useful to observe that Browswer.Navigation.load, Browser.Navigation.pushUrl, or Browser.Navigation.replaceUrl was executed with the value you expect.

Note that you can use Spec.Setup.withLocation to set the base location of the document at the start of the scenario.

expectReload : Expectation model

Expect that a Browser.Navigation.reload or Browser.Navigation.reloadAndSkipCache command was executed.