From 900fcb9da0313ee3ab5e6c841b686674077a4d87 Mon Sep 17 00:00:00 2001 From: Isaac Janzen Date: Tue, 19 Apr 2022 15:48:18 -0500 Subject: [PATCH] Add a test for topic timer notice --- .../tests/acceptance/topic-edit-timer-test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js index 2ef5bc385cb..ed49efa101e 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js @@ -370,4 +370,18 @@ acceptance("Topic - Edit timer", function (needs) { assert.deepEqual(options, expected); }); + + test("Does not show timer notice unless timer set", async function (assert) { + updateCurrentUser({ moderator: true }); + + await visit("/t/internationalization-localization"); + await click(".toggle-admin-menu"); + await click(".admin-topic-timer-update button"); + + const timerType = selectKit(".select-kit.timer-type"); + await timerType.expand(); + await timerType.selectRowByValue("close_after_last_post"); + + assert.notOk(exists(".topic-timer-heading")); + }); });