Skip to content

Conversation

@avh4
Copy link
Owner

@avh4 avh4 commented Mar 22, 2018

(and some unrelated additions of other functions)

@avh4
Copy link
Owner Author

avh4 commented Mar 22, 2018

Another, @brookeangel?

{-| This resolves a URL string (either an absolute or relative URL) against a base URL (given as a `Location`).
-}
resolve : Navigation.Location -> String -> Navigation.Location
resolve base url =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, spooky - so it's okay that this allows people to get around the valid pathname constraint for now?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually how it should work (except for the unimplemented algorithm, of course).. this lets you call TestContext.routeChange in your test with a relative URL, and the relative URL you pass will be resolved against the current URL. So createWithNavigation still requires an absolute URL, but URLs given later will (hopefully) act the same as URLs in <a> tags that the user might click.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, got it! That seems right 👍

-}
fail : String -> String -> TestContext msg model effect -> TestContext msg model effect
fail assertionName failureMessage (TestContext result) =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you added this function!

}


createWithJsonStringFlags :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the options!!!

Copy link
Collaborator

@brookeangel brookeangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'm assuming more Location stuff is yet to come?

@avh4
Copy link
Owner Author

avh4 commented Mar 23, 2018

Location stuff is currently sufficient for what the NoRedInk repo needs. So I'm not planning to do more on that now, but can be added in the future as people need it.

@avh4 avh4 merged commit 1958983 into master Mar 23, 2018
nunntom added a commit to nunntom/elm-program-test that referenced this pull request Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants