fix: hide new post indicator on thread open
This fixes the removal of the new post indicator in the Discussion XBlock once a thread has been opened.
This commit is contained in:
@@ -154,6 +154,7 @@
|
||||
});
|
||||
this.threadView.render();
|
||||
this.listenTo(this.threadView.showView, 'thread:_delete', this.navigateToAllPosts);
|
||||
this.$(".forum-nav-thread[data-id='" + threadId + "']").removeClass('never-read');
|
||||
this.threadListView.$el.addClass('is-hidden');
|
||||
this.$('.inline-thread').removeClass('is-hidden');
|
||||
},
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
});
|
||||
|
||||
createTestView = function(test) {
|
||||
var testView;
|
||||
var courseSettings = DiscussionSpecHelper.createTestCourseSettings({
|
||||
groups: [
|
||||
{
|
||||
@@ -62,7 +63,7 @@
|
||||
children: []
|
||||
}
|
||||
});
|
||||
var testView = new DiscussionInlineView({
|
||||
testView = new DiscussionInlineView({
|
||||
el: $('.discussion-module')
|
||||
});
|
||||
testView.render();
|
||||
@@ -234,6 +235,22 @@
|
||||
// Verify that the individual thread is no longer shown
|
||||
expect(testView.$('.group-visibility-label').length).toBe(0);
|
||||
});
|
||||
|
||||
it('marks a thread as read once it is opened', function() {
|
||||
var testView = createTestView(this);
|
||||
var thread;
|
||||
showDiscussion(this, testView);
|
||||
thread = testView.$('.forum-nav-thread');
|
||||
|
||||
// The thread is marked as unread.
|
||||
expect(thread).toHaveClass('never-read');
|
||||
|
||||
// Navigate to the thread.
|
||||
thread.find('.forum-nav-thread-link').click();
|
||||
|
||||
// The thread is no longer marked as unread.
|
||||
expect(thread).not.toHaveClass('never-read');
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user