fix failing spec
This commit is contained in:
parent
48c4f192e9
commit
a0c5b48558
|
@ -40,9 +40,9 @@ QUnit.test('replying to post - reply_as_private_message', assert => {
|
||||||
QUnit.test('replying to post - reply_to_topic', async assert => {
|
QUnit.test('replying to post - reply_to_topic', async assert => {
|
||||||
const composerActions = selectKit('.composer-actions');
|
const composerActions = selectKit('.composer-actions');
|
||||||
|
|
||||||
await visit('/t/internationalization-localization/280');
|
visit('/t/internationalization-localization/280');
|
||||||
await click('article#post_3 button.reply');
|
click('article#post_3 button.reply');
|
||||||
await fillIn('.d-editor-input', 'test replying to topic when initially replied to post');
|
fillIn('.d-editor-input', 'test replying to topic when initially replied to post');
|
||||||
|
|
||||||
await composerActions.expandAwait();
|
await composerActions.expandAwait();
|
||||||
await composerActions.selectRowByValueAwait('reply_to_topic');
|
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 composerActions = selectKit('.composer-actions');
|
||||||
const quote = 'Life is like riding a bicycle.';
|
const quote = 'Life is like riding a bicycle.';
|
||||||
|
|
||||||
visit('/t/internationalization-localization/280');
|
await visit('/t/internationalization-localization/280');
|
||||||
click('article#post_3 button.reply');
|
await click('article#post_3 button.reply');
|
||||||
fillIn('.d-editor-input', quote);
|
await fillIn('.d-editor-input', quote);
|
||||||
composerActions.expand().selectRowByValue('reply_to_topic');
|
|
||||||
|
|
||||||
andThen(() => {
|
await composerActions.expandAwait();
|
||||||
assert.equal(find('.action-title').text().trim(), "Internationalization / localization");
|
await composerActions.selectRowByValueAwait('reply_to_topic');
|
||||||
assert.equal(find('.d-editor-input').val(), quote);
|
|
||||||
});
|
|
||||||
|
|
||||||
composerActions.expand();
|
assert.equal(find('.action-title').text().trim(), "Internationalization / localization");
|
||||||
|
assert.equal(find('.d-editor-input').val(), quote);
|
||||||
|
|
||||||
andThen(() => {
|
await composerActions.expandAwait();
|
||||||
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);
|
|
||||||
});
|
|
||||||
|
|
||||||
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(() => {
|
await composerActions.selectRowByValueAwait('reply_to_post');
|
||||||
assert.ok(exists(find('.action-title img.avatar')));
|
await composerActions.expandAwait();
|
||||||
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);
|
|
||||||
});
|
|
||||||
|
|
||||||
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(() => {
|
await composerActions.selectRowByValueAwait('reply_as_new_topic');
|
||||||
assert.equal(find('.action-title').text().trim(), I18n.t("topic.create_long"));
|
await composerActions.expandAwait();
|
||||||
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');
|
|
||||||
});
|
|
||||||
|
|
||||||
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(() => {
|
await composerActions.selectRowByValueAwait('reply_as_private_message');
|
||||||
assert.equal(find('.action-title').text().trim(), I18n.t("topic.private_message"));
|
await composerActions.expandAwait();
|
||||||
assert.ok(find('.d-editor-input').val().indexOf("Continuing the discussion") === 0);
|
|
||||||
assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic');
|
assert.equal(find('.action-title').text().trim(), I18n.t("topic.private_message"));
|
||||||
assert.equal(composerActions.rowByIndex(1).value(), 'reply_to_post');
|
assert.ok(find('.d-editor-input').val().indexOf("Continuing the discussion") === 0);
|
||||||
assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic');
|
assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic');
|
||||||
assert.equal(composerActions.rowByIndex(3).value(), undefined);
|
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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue