Skip to content
Snippets Groups Projects
Unverified Commit b62478c3 authored by Paul Aswa's avatar Paul Aswa Committed by Agrendalath
Browse files

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.
parent d1856c27
No related branches found
No related tags found
No related merge requests found
......@@ -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');
});
});
});
}());
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment