Fix bug where new posts were not assigned a topic ID and would fail to post
TNL-5442
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
font-size: $forum-base-font-size;
|
||||
}
|
||||
|
||||
a.topic-title {
|
||||
button.topic-title {
|
||||
@include transition(none);
|
||||
|
||||
&:hover, &:focus {
|
||||
|
||||
Reference in New Issue
Block a user