diff --git a/test/javascripts/acceptance/composer-actions-test.js.es6 b/test/javascripts/acceptance/composer-actions-test.js.es6 index ca0cffdba1f..55b6736c858 100644 --- a/test/javascripts/acceptance/composer-actions-test.js.es6 +++ b/test/javascripts/acceptance/composer-actions-test.js.es6 @@ -40,9 +40,9 @@ QUnit.test('replying to post - reply_as_private_message', assert => { QUnit.test('replying to post - reply_to_topic', async assert => { const composerActions = selectKit('.composer-actions'); - 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'); + visit('/t/internationalization-localization/280'); + click('article#post_3 button.reply'); + fillIn('.d-editor-input', 'test replying to topic when initially replied to post'); await composerActions.expandAwait(); await composerActions.selectRowByValueAwait('reply_to_topic'); @@ -107,62 +107,57 @@ QUnit.test('shared draft', assert => { }); }); -QUnit.skip('interactions', assert => { +QUnit.test('interactions', async assert => { const composerActions = selectKit('.composer-actions'); const quote = 'Life is like riding a bicycle.'; - visit('/t/internationalization-localization/280'); - click('article#post_3 button.reply'); - fillIn('.d-editor-input', quote); - composerActions.expand().selectRowByValue('reply_to_topic'); + await visit('/t/internationalization-localization/280'); + await click('article#post_3 button.reply'); + await fillIn('.d-editor-input', quote); - andThen(() => { - assert.equal(find('.action-title').text().trim(), "Internationalization / localization"); - assert.equal(find('.d-editor-input').val(), quote); - }); + await composerActions.expandAwait(); + await composerActions.selectRowByValueAwait('reply_to_topic'); - composerActions.expand(); + assert.equal(find('.action-title').text().trim(), "Internationalization / localization"); + assert.equal(find('.d-editor-input').val(), quote); - andThen(() => { - assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic'); - assert.equal(composerActions.rowByIndex(1).value(), 'reply_to_post'); - assert.equal(composerActions.rowByIndex(2).value(), 'reply_as_private_message'); - assert.equal(composerActions.rowByIndex(3).value(), 'toggle_whisper'); - assert.equal(composerActions.rowByIndex(4).value(), undefined); - }); + await composerActions.expandAwait(); - composerActions.selectRowByValue('reply_to_post').expand(); + assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic'); + assert.equal(composerActions.rowByIndex(1).value(), 'reply_to_post'); + assert.equal(composerActions.rowByIndex(2).value(), 'reply_as_private_message'); + assert.equal(composerActions.rowByIndex(3).value(), 'toggle_whisper'); + assert.equal(composerActions.rowByIndex(4).value(), undefined); - andThen(() => { - assert.ok(exists(find('.action-title img.avatar'))); - assert.equal(find('.action-title .user-link').text().trim(), "codinghorror"); - assert.equal(find('.d-editor-input').val(), quote); - assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic'); - assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message'); - assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic'); - assert.equal(composerActions.rowByIndex(3).value(), 'toggle_whisper'); - assert.equal(composerActions.rowByIndex(4).value(), undefined); - }); + await composerActions.selectRowByValueAwait('reply_to_post'); + await composerActions.expandAwait(); - composerActions.selectRowByValue('reply_as_new_topic').expand(); + assert.ok(exists(find('.action-title img.avatar'))); + assert.equal(find('.action-title .user-link').text().trim(), "codinghorror"); + assert.equal(find('.d-editor-input').val(), quote); + assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic'); + assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message'); + assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic'); + assert.equal(composerActions.rowByIndex(3).value(), 'toggle_whisper'); + assert.equal(composerActions.rowByIndex(4).value(), undefined); - andThen(() => { - assert.equal(find('.action-title').text().trim(), I18n.t("topic.create_long")); - assert.ok(find('.d-editor-input').val().includes(quote)); - assert.equal(composerActions.rowByIndex(0).value(), 'reply_to_post'); - assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message'); - assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic'); - assert.equal(composerActions.rowByIndex(3).value(), 'shared_draft'); - }); + await composerActions.selectRowByValueAwait('reply_as_new_topic'); + await composerActions.expandAwait(); - composerActions.selectRowByValue('reply_as_private_message').expand(); + assert.equal(find('.action-title').text().trim(), I18n.t("topic.create_long")); + assert.ok(find('.d-editor-input').val().includes(quote)); + assert.equal(composerActions.rowByIndex(0).value(), 'reply_to_post'); + assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message'); + assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic'); + assert.equal(composerActions.rowByIndex(3).value(), 'shared_draft'); - andThen(() => { - assert.equal(find('.action-title').text().trim(), I18n.t("topic.private_message")); - assert.ok(find('.d-editor-input').val().indexOf("Continuing the discussion") === 0); - assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic'); - assert.equal(composerActions.rowByIndex(1).value(), 'reply_to_post'); - assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic'); - assert.equal(composerActions.rowByIndex(3).value(), undefined); - }); + await composerActions.selectRowByValueAwait('reply_as_private_message'); + await composerActions.expandAwait(); + + assert.equal(find('.action-title').text().trim(), I18n.t("topic.private_message")); + assert.ok(find('.d-editor-input').val().indexOf("Continuing the discussion") === 0); + assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic'); + assert.equal(composerActions.rowByIndex(1).value(), 'reply_to_post'); + assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic'); + assert.equal(composerActions.rowByIndex(3).value(), undefined); });