FEATURE: remove the featured link by editing the topic

This commit is contained in:
Neil Lalonde
2017-11-22 14:53:35 -05:00
parent d32c95b6e8
commit 6c86e0c94a
10 changed files with 63 additions and 8 deletions

View File

@ -37,6 +37,7 @@ QUnit.test("Showing and hiding the edit controls", assert => {
andThen(() => {
assert.ok(exists('#edit-title'), 'it shows the editing controls');
assert.ok(!exists('.title-wrapper .remove-featured-link'), 'link to remove featured link is not shown');
});
fillIn('#edit-title', 'this is the new title');
@ -174,3 +175,29 @@ QUnit.test("Updating the topic title with emojis", assert => {
assert.equal(find('.fancy-title').html().trim(), 'emojis title <img src=\"/images/emoji/emoji_one/bike.png?v=5\" title=\"bike\" alt=\"bike\" class=\"emoji\"> <img src=\"/images/emoji/emoji_one/blonde_woman/6.png?v=5\" title=\"blonde_woman:t6\" alt=\"blonde_woman:t6\" class=\"emoji\">', 'it displays the new title with emojis');
});
});
acceptance("Topic featured links", {
loggedIn: true,
settings: {
topic_featured_link_enabled: true,
max_topic_title_length: 80
}
});
QUnit.test("remove featured link", assert => {
visit("/t/299/1");
andThen(() => {
assert.ok(exists('.title-wrapper .topic-featured-link'), 'link is shown with topic title');
});
click('.title-wrapper .edit-topic');
andThen(() => {
assert.ok(exists('.title-wrapper .remove-featured-link'), 'link to remove featured link');
});
click('.title-wrapper .remove-featured-link');
click('.title-wrapper .submit-edit');
andThen(() => {
assert.ok(!exists('.title-wrapper .topic-featured-link'), 'link is gone');
});
});