Skip to content

A platform for community discussion. Free, open, simple.

improve erratic test

Sam9e2131ace890
diff --git a/test/javascripts/acceptance/composer-actions-test.js.es6 b/test/javascripts/acceptance/composer-actions-test.js.es6
index 77a44761f8f..ca0cffdba1f 100644
--- a/test/javascripts/acceptance/composer-actions-test.js.es6
+++ b/test/javascripts/acceptance/composer-actions-test.js.es6
@@ -37,19 +37,19 @@ QUnit.test('replying to post - reply_as_private_message', assert => {
});
});
-QUnit.test('replying to post - reply_to_topic', assert => {
+QUnit.test('replying to post - reply_to_topic', async assert => {
const composerActions = selectKit('.composer-actions');
- visit('/t/internationalization-localization/280');
- click('article#post_3 button.reply');
- fillIn('.d-editor-input', 'test replying to topic when initially replied to post');
- composerActions.expand().selectRowByValue('reply_to_topic');
+ await visit('/t/internationalization-localization/280');
+ await click('article#post_3 button.reply');
+ await fillIn('.d-editor-input', 'test replying to topic when initially replied to post');
- andThen(() => {
- assert.equal(find('.action-title .topic-link').text().trim(), 'Internationalization / localization');
- assert.equal(find('.action-title .topic-link').attr("href"), '/t/internationalization-localization/280');
- assert.equal(find('.d-editor-input').val(), 'test replying to topic when initially replied to post');
- });
+ await composerActions.expandAwait();
+ await composerActions.selectRowByValueAwait('reply_to_topic');
+
+ assert.equal(find('.action-title .topic-link').text().trim(), 'Internationalization / localization');
+ assert.equal(find('.action-title .topic-link').attr("href"), '/t/internationalization-localization/280');
+ assert.equal(find('.d-editor-input').val(), 'test replying to topic when initially replied to post');
});
QUnit.test('replying to post - toggle_whisper', assert => {
diff --git a/test/javascripts/helpers/select-kit-helper.js b/test/javascripts/helpers/select-kit-helper.js
index 8bdceccd7c8..c54c8435dd2 100644
--- a/test/javascripts/helpers/select-kit-helper.js
+++ b/test/javascripts/helpers/select-kit-helper.js
@@ -124,6 +124,10 @@ function selectKit(selector) { // eslint-disable-line no-unused-vars
return selectKit(selector);
},
+ selectRowByValueAwait: function(value) {
+ return selectKitSelectRowByValue(value, selector);
+ },
+
selectRowByValue: function(value) {
selectKitSelectRowByValue(value, selector);
return selectKit(selector);