-
Notifications
You must be signed in to change notification settings - Fork 44
Feature/set html #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/set html #134
Conversation
test/integration/element_test.exs
Outdated
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no more than 1 consecutive blank lines.
test/integration/element_test.exs
Outdated
| end | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no more than 1 consecutive blank lines.
test/integration/element_test.exs
Outdated
| assert {:ok, 1} == set_html(socket, "#my_element", "<p>Hello, World!</p> ") | ||
| end | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no more than 1 consecutive blank lines.
test/integration/element_test.exs
Outdated
| end | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no more than 1 consecutive blank lines.
test/integration/element_test.exs
Outdated
| assert visible_text(out) == "inner outer clicked" | ||
| end | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no more than 1 consecutive blank lines.
grych
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the spec, and please fix the ebert complains.
lib/drab/element.ex
Outdated
| Returns number of updated element. | ||
| """ | ||
| @spec set_html(Phoenix.Socket.t(), String.t(), String.t()) :: Drab.Core.result() | no_return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be spec for set_html! (with bang)
test/integration/element_test.exs
Outdated
|
|
||
| test "set_html" do | ||
| socket = drab_socket() | ||
| assert {:ok, 1} == set_html(socket, "#my_element", "<p>Hello, World!</p> ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to check also if it was actually set, so after set_html check something like:
assert %{"#my_element" => %{"innerHTML" => "<p>Hello, World!</p>"}} == query_one!(socket, "#my_element", :innerHTML}
|
I'm back, I'm going to fix everything |
|
Ebert has finished reviewing this Pull Request and has found:
But beware that this branch is 56 commits behind the You can see more details about this review at https://ebertapp.io/github/grych/drab/pulls/134. |
Let me know if you need a more extensive test for this feature