Commit 628ec509 by Brian Jacobel Committed by GitHub

Merge pull request #12859 from edx/bjacobel/TNL-4392

Fix TNL-4392
parents e19fb06e 24b22a8e
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
body: "this is a comment", body: "this is a comment",
created_at: "2013-04-03T20:08:39Z", created_at: "2013-04-03T20:08:39Z",
endorsed: false, endorsed: false,
endorsement: {},
abuse_flaggers: [], abuse_flaggers: [],
votes: { votes: {
up_count: 42 up_count: 42
...@@ -132,7 +133,12 @@ ...@@ -132,7 +133,12 @@
this.view.$(".action-answer").click(); this.view.$(".action-answer").click();
expect(this.view.$(".posted-details").text()).toMatch("marked as answer"); expect(this.view.$(".posted-details").text()).toMatch("marked as answer");
this.view.$(".action-answer").click(); this.view.$(".action-answer").click();
return expect(this.view.$(".posted-details").text()).not.toMatch("marked as answer"); expect(this.view.$(".posted-details").text()).not.toMatch("marked as answer");
// Previously the endorsement state would revert after a page load due to a bug in the template
this.view.render();
expect(this.view.$(".posted-details").text()).not.toMatch("marked as answer");
}); });
it("allows a moderator to mark an answer in a question thread", function() { it("allows a moderator to mark an answer in a question thread", function() {
var endorseButton; var endorseButton;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<%= author_display %> <%= author_display %>
<p class="posted-details"> <p class="posted-details">
<span class="timeago" title="<%= created_at %>"><%= created_at %></span> <span class="timeago" title="<%= created_at %>"><%= created_at %></span>
<% if (obj.endorsement) { %> <% if (obj.endorsement && obj.endorsed) { %>
- -
<% <%
var fmt = null; var fmt = null;
......
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