Commit 40dcb510 by attiyaIshaque

Merge pull request #11850 from edx/ai/tnl3964-forum-vote-button

Fix styling of vote button in forums responses.
parents 69339390 1e74f942
......@@ -23,6 +23,14 @@ class @DiscussionViewSpecHelper
}
$.extend(thread, props)
@checkVoteClasses = (view) ->
view.render()
display_button = view.$el.find(".display-vote")
expect(display_button.hasClass("is-hidden")).toBe(true)
action_button = view.$el.find(".action-vote")
# Check that inline css is not applied to the ".action-vote"
expect(action_button).not.toHaveAttr('style','display: inline; ');
@expectVoteRendered = (view, model, user) ->
button = view.$el.find(".action-vote")
expect(button.hasClass("is-checked")).toBe(user.voted(model))
......
......@@ -30,6 +30,9 @@ describe "ThreadResponseShowView", ->
it "renders the vote state correctly", ->
DiscussionViewSpecHelper.checkRenderVote(@view, @comment)
it "check the vote classes after renders", ->
DiscussionViewSpecHelper.checkVoteClasses(@view)
it "votes correctly via click", ->
DiscussionViewSpecHelper.checkUpvote(@view, @comment, @user, $.Event("click"))
......
......@@ -138,7 +138,6 @@ if Backbone?
closed: (closed) ->
@updateButtonState(".action-close", closed)
@$(".post-label-closed").toggleClass("is-hidden", not closed)
@$(".action-vote").toggle(not closed)
@$(".display-vote").toggle(closed)
})
......
<li class="actions-item">
<span aria-hidden="true" class="display-vote" >
<span aria-hidden="true" class="display-vote is-hidden" >
<span class="vote-count"></span>
</span>
<a href="#" class="action-button action-vote" role="checkbox" aria-checked="false">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment