Commit 269a8e9d by Attiya Ishaque Committed by attiyaishaque

Styling on forums response vote button.

parent 1cef5827
...@@ -23,6 +23,14 @@ class @DiscussionViewSpecHelper ...@@ -23,6 +23,14 @@ class @DiscussionViewSpecHelper
} }
$.extend(thread, props) $.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) -> @expectVoteRendered = (view, model, user) ->
button = view.$el.find(".action-vote") button = view.$el.find(".action-vote")
expect(button.hasClass("is-checked")).toBe(user.voted(model)) expect(button.hasClass("is-checked")).toBe(user.voted(model))
......
...@@ -30,6 +30,9 @@ describe "ThreadResponseShowView", -> ...@@ -30,6 +30,9 @@ describe "ThreadResponseShowView", ->
it "renders the vote state correctly", -> it "renders the vote state correctly", ->
DiscussionViewSpecHelper.checkRenderVote(@view, @comment) DiscussionViewSpecHelper.checkRenderVote(@view, @comment)
it "check the vote classes after renders", ->
DiscussionViewSpecHelper.checkVoteClasses(@view)
it "votes correctly via click", -> it "votes correctly via click", ->
DiscussionViewSpecHelper.checkUpvote(@view, @comment, @user, $.Event("click")) DiscussionViewSpecHelper.checkUpvote(@view, @comment, @user, $.Event("click"))
......
...@@ -138,7 +138,6 @@ if Backbone? ...@@ -138,7 +138,6 @@ if Backbone?
closed: (closed) -> closed: (closed) ->
@updateButtonState(".action-close", closed) @updateButtonState(".action-close", closed)
@$(".post-label-closed").toggleClass("is-hidden", not closed) @$(".post-label-closed").toggleClass("is-hidden", not closed)
@$(".action-vote").toggle(not closed)
@$(".display-vote").toggle(closed) @$(".display-vote").toggle(closed)
}) })
......
<li class="actions-item"> <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 class="vote-count"></span>
</span> </span>
<a href="#" class="action-button action-vote" role="checkbox" aria-checked="false"> <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