mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 02:36:15 +08:00
FEATURE: links that can't have no onebox can be used as featured topic links
This commit is contained in:
parent
bebc55eebd
commit
a6ebe495bf
|
@ -68,7 +68,8 @@ export default Ember.Component.extend({
|
|||
|
||||
if (loadOnebox && loadOnebox.then) {
|
||||
loadOnebox.then( () => {
|
||||
this._updatePost(lookupCache(this.get('composer.title')));
|
||||
const v = lookupCache(this.get('composer.title'));
|
||||
this._updatePost(v ? v : link);
|
||||
}).finally(() => {
|
||||
this.set('composer.loading', false);
|
||||
Ember.run.schedule('afterRender', () => { this.$('input').putCursorAtEnd(); });
|
||||
|
|
|
@ -35,8 +35,8 @@ test("no onebox result", () => {
|
|||
click('#create-topic');
|
||||
fillIn('#reply-title', "http://www.example.com/nope-onebox.html");
|
||||
andThen(() => {
|
||||
equal(find('.d-editor-preview').html().trim().indexOf('onebox'), -1, "link isn't put into the post");
|
||||
equal(find('.d-editor-input').val().length, 0, "link isn't put into the post");
|
||||
ok(find('.d-editor-preview').html().trim().indexOf('onebox') > 0, "it pastes the link into the body and previews it");
|
||||
ok(exists('.d-editor-textarea-wrapper .popup-tip.good'), 'link is pasted into body');
|
||||
equal(find('.title-input input').val(), "http://www.example.com/nope-onebox.html", "title is unchanged");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user