From 50c23304ac56d8eb77c15b81aafc13fca797f2e8 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Thu, 25 Mar 2021 15:04:51 +0100 Subject: [PATCH] DEV: Move incorrectly placed topic tests (#12513) The diff is confusing but the gist is that there are some topic acceptance tests that were incorrectly placed in "Topic featured links" group. This moves them into "Topic". Moved tests: * Converting to a public topic * Unpinning unlisted topic * selecting posts * select below * View Hidden Replies * Quoting a quote keeps the original poster name * Quoting a quote of a different topic keeps the original topic title * Quoting a quote with the Reply button keeps the original poster name * Quoting a quote with replyAsNewTopic keeps the original poster name * Quoting by selecting text can mark the quote as full --- .../discourse/tests/acceptance/topic-test.js | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js index b5d14add38a..32fd762985b 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js @@ -260,35 +260,6 @@ acceptance("Topic", function (needs) { assert.ok(exists(".category-moderator"), "it has a class applied"); assert.ok(exists(".d-icon-shield-alt"), "it shows an icon"); }); -}); - -acceptance("Topic featured links", function (needs) { - needs.user(); - needs.settings({ - topic_featured_link_enabled: true, - max_topic_title_length: 80, - }); - test("remove featured link", async function (assert) { - await visit("/t/-/299/1"); - assert.ok( - exists(".title-wrapper .topic-featured-link"), - "link is shown with topic title" - ); - - await click(".title-wrapper .edit-topic"); - assert.ok( - exists(".title-wrapper .remove-featured-link"), - "link to remove featured link" - ); - - // TODO: decide if we want to test this, test is flaky so it - // was commented out. - // If not fixed by May 2021, delete this code block - // - //await click(".title-wrapper .remove-featured-link"); - //await click(".title-wrapper .submit-edit"); - //assert.ok(!exists(".title-wrapper .topic-featured-link"), "link is gone"); - }); test("Converting to a public topic", async function (assert) { await visit("/t/test-pm/34"); @@ -433,6 +404,36 @@ acceptance("Topic featured links", function (needs) { }); }); +acceptance("Topic featured links", function (needs) { + needs.user(); + needs.settings({ + topic_featured_link_enabled: true, + max_topic_title_length: 80, + }); + + test("remove featured link", async function (assert) { + await visit("/t/-/299/1"); + assert.ok( + exists(".title-wrapper .topic-featured-link"), + "link is shown with topic title" + ); + + await click(".title-wrapper .edit-topic"); + assert.ok( + exists(".title-wrapper .remove-featured-link"), + "link to remove featured link" + ); + + // TODO: decide if we want to test this, test is flaky so it + // was commented out. + // If not fixed by May 2021, delete this code block + // + //await click(".title-wrapper .remove-featured-link"); + //await click(".title-wrapper .submit-edit"); + //assert.ok(!exists(".title-wrapper .topic-featured-link"), "link is gone"); + }); +}); + acceptance("Topic with title decorated", function (needs) { needs.user(); needs.hooks.beforeEach(() => { @@ -442,6 +443,7 @@ acceptance("Topic with title decorated", function (needs) { }); }); }); + test("Decorate topic title", async function (assert) { await visit("/t/internationalization-localization/280");