Closed
Conversation
fatboypunk
commented
Oct 20, 2021
fatboypunk
commented
Oct 20, 2021
Contributor
Author
b5b10b5 to
a97db01
Compare
- This allows users to specify the button they want to submit the form with. - If the button that's submitted has a `name`it will show up in the params.
834c5dc to
89cee46
Compare
Codecov Report
@@ Coverage Diff @@
## marcel/submit-form #94 +/- ##
=======================================================
- Coverage 93.67% 78.53% -15.14%
=======================================================
Files 9 9
Lines 158 191 +33
=======================================================
+ Hits 148 150 +2
- Misses 10 41 +31
Continue to review full report at Codecov.
|
| def submit_form(conn, attrs, entity, test_selector), | ||
| do: dispatch_form(conn, attrs, entity, test_selector) | ||
|
|
||
| @spec submit_form(Plug.Conn.t(), %{}, binary()) :: Plug.Conn.t() |
Collaborator
There was a problem hiding this comment.
Suggested change
| @spec submit_form(Plug.Conn.t(), %{}, binary()) :: Plug.Conn.t() | |
| @spec submit_with_button(Plug.Conn.t(), %{}, binary()) :: Plug.Conn.t() |
| input_submit || button_submit | ||
| end | ||
|
|
||
| def text(html_tree), |
Collaborator
There was a problem hiding this comment.
Suggested change
| def text(html_tree), | |
| defp text(html_tree), |
| def text(html_tree), | ||
| do: html_tree |> Floki.text() |> String.replace(~r/\s+/, " ") |> String.trim() | ||
|
|
||
| defp all_buttons(html_tree) do |
Collaborator
There was a problem hiding this comment.
Suggested change
| defp all_buttons(html_tree) do | |
| defp all_submit_controls(html_tree) do |
or something like it? :p
EasterPeanut
approved these changes
Oct 22, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.