Skip to content

Feature/set html#134

Merged
grych merged 5 commits intogrych:masterfrom
guidotripaldi:feature/set_html
May 29, 2018
Merged

Feature/set html#134
grych merged 5 commits intogrych:masterfrom
guidotripaldi:feature/set_html

Conversation

@guidotripaldi
Copy link
Copy Markdown
Contributor

Let me know if you need a more extensive test for this feature





Copy link
Copy Markdown

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.

end



Copy link
Copy Markdown

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.

assert {:ok, 1} == set_html(socket, "#my_element", "<p>Hello, World!</p> ")
end


Copy link
Copy Markdown

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.

end



Copy link
Copy Markdown

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.

assert visible_text(out) == "inner outer clicked"
end


Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Owner

@grych grych left a 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.


Returns number of updated element.
"""
@spec set_html(Phoenix.Socket.t(), String.t(), String.t()) :: Drab.Core.result() | no_return
Copy link
Copy Markdown
Owner

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 "set_html" do
socket = drab_socket()
assert {:ok, 1} == set_html(socket, "#my_element", "<p>Hello, World!</p> ")
Copy link
Copy Markdown
Owner

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}

@guidotripaldi
Copy link
Copy Markdown
Contributor Author

I'm back, I'm going to fix everything

@sourcelevel-bot
Copy link
Copy Markdown

Ebert has finished reviewing this Pull Request and has found:

  • 12 possible new issues (including those that may have been commented here).
  • 9 fixed issues! 🎉

But beware that this branch is 56 commits behind the grych:master branch, and a review of an up to date branch would produce more accurate results.

You can see more details about this review at https://ebertapp.io/github/grych/drab/pulls/134.

@grych grych merged commit 37cb781 into grych:master May 29, 2018
@grych grych mentioned this pull request May 29, 2018
@guidotripaldi guidotripaldi deleted the feature/set_html branch August 31, 2018 05:42
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.

2 participants