Styling on forums response vote button.
This commit is contained in:
committed by
attiyaishaque
parent
1cef58271b
commit
269a8e9d4d
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<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">
|
||||
|
||||
Reference in New Issue
Block a user