Commit 2e0b6c12 by Brian Jacobel Committed by GitHub

Merge pull request #13418 from edx/bjacobel/new-post-bug

Fix bug where new posts were not assigned a topic ID and would fail to post
parents 6aaf442d 545ef583
......@@ -46,7 +46,7 @@
'[data-discussion-id="' + this.getCurrentTopicId() + '"]')
);
} else {
this.setTopic(this.$('.topic-title').first());
this.setTopic(this.$('button.topic-title').first());
}
return this.$el;
},
......
......@@ -177,7 +177,7 @@
DiscussionUtil.clearFormErrors(this.$('.post-errors'));
this.$('.wmd-preview p').html('');
if (this.isTabMode()) {
return this.topicView.setTopic(this.$('.topic-title').first());
return this.topicView.setTopic(this.$('button.topic-title').first());
}
};
......
......@@ -135,7 +135,7 @@
var dropdownText;
this.createTopicView();
this.view.maxNameWidth = this.selectedOptionText.length + 100;
this.view.$el.find('.topic-title').first().click();
this.view.$el.find('button.topic-title').first().click();
dropdownText = this.view.$el.find('.js-selected-topic').text();
expect(dropdownText.indexOf('/ span>')).toEqual(-1);
});
......@@ -152,6 +152,15 @@
expect(completeText).toEqual(dropdownText);
});
it("defaults to the first topic if you don't click one", function() {
this.createTopicView();
expect(
this.view.$el.find('.js-selected-topic').text()
).toMatch(
this.view.$el.find('.topic-menu-entry')[0].innerHTML
);
});
it('click outside of the dropdown close it', function() {
this.createTopicView();
this.openMenu();
......
......@@ -248,7 +248,7 @@
font-size: $forum-base-font-size;
}
a.topic-title {
button.topic-title {
@include transition(none);
&:hover, &:focus {
......
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