From 2808e3f63eeaa049ef0b7779d4572c5777db335e Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 11 Jul 2017 22:43:33 +0100 Subject: [PATCH] Fix for the last broken discourse-details qunit test --- .../acceptance/details-button-test.js.es6 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 index e429c96e715..61ffac21528 100644 --- a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 +++ b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 @@ -58,7 +58,7 @@ test('details button', (assert) => { andThen(() => { assert.equal( find(".d-editor-input").val(), - `Before\n[details=${I18n.t("composer.details_title")}]\nsome text in between\n[/details]\nAfter`, + `Before \n[details=${I18n.t("composer.details_title")}]\nsome text in between\n[/details]\n After`, 'it should contain the right output' ); @@ -67,12 +67,12 @@ test('details button', (assert) => { assert.equal(textarea.selectionEnd, 46, 'it should end highlighting at the right position'); }); - fillIn('.d-editor-input', "Before\nsome text in between\nAfter"); + fillIn('.d-editor-input', "Before \nsome text in between\n After"); andThen(() => { const textarea = findTextarea(); - textarea.selectionStart = 7; - textarea.selectionEnd = 28; + textarea.selectionStart = 8; + textarea.selectionEnd = 29; }); click('button.options'); @@ -81,12 +81,12 @@ test('details button', (assert) => { andThen(() => { assert.equal( find(".d-editor-input").val(), - `Before\n\n[details=${I18n.t("composer.details_title")}]\nsome text in between\n[/details]\n\nAfter`, + `Before \n\n[details=${I18n.t("composer.details_title")}]\nsome text in between\n[/details]\n\n After`, 'it should contain the right output' ); const textarea = findTextarea(); - assert.equal(textarea.selectionStart, 26, 'it should start highlighting at the right position'); - assert.equal(textarea.selectionEnd, 46, 'it should end highlighting at the right position'); + assert.equal(textarea.selectionStart, 27, 'it should start highlighting at the right position'); + assert.equal(textarea.selectionEnd, 47, 'it should end highlighting at the right position'); }); });