From 49bc53dbc91d28a31884ab4eefe7adf3a58172bf Mon Sep 17 00:00:00 2001 From: Matthew Beale Date: Tue, 17 Nov 2015 12:01:23 -0500 Subject: [PATCH] Fix DOM-dependent tests for IE Edge --- tests/acceptance/editor-sections-test.js | 4 ++-- tests/acceptance/editor-selections-test.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/editor-sections-test.js b/tests/acceptance/editor-sections-test.js index ebcca9c9b..a212ccb10 100644 --- a/tests/acceptance/editor-sections-test.js +++ b/tests/acceptance/editor-sections-test.js @@ -484,7 +484,7 @@ test('deleting when after deletion there is a trailing space positions cursor at Helpers.dom.insertText(editor, text); setTimeout(() => { - assert.equal($('#editor p:eq(0)').text(), `first ${text}`, 'character is placed after space'); + assert.equal(editor.post.sections.head.text, `first ${text}`, 'character is placed after space'); done(); }); @@ -504,7 +504,7 @@ test('deleting when after deletion there is a leading space positions cursor at Helpers.dom.insertText(editor, text); setTimeout(() => { - assert.equal($('#editor p:eq(1)').text(), `${text} section`, 'correct text after insertion'); + assert.equal(editor.post.sections.tail.text, `${text} section`, 'correct text after insertion'); done(); }); }); diff --git a/tests/acceptance/editor-selections-test.js b/tests/acceptance/editor-selections-test.js index afb089144..09c78bd7d 100644 --- a/tests/acceptance/editor-selections-test.js +++ b/tests/acceptance/editor-selections-test.js @@ -280,12 +280,12 @@ test('selecting text bounded by space and typing replaces it', (assert) => { Helpers.dom.selectText('trick', editorElement); Helpers.dom.insertText(editor, 'X'); - assert.hasElement('#editor p:contains(one X pony)', - 'new text present'); + assert.equal(editor.post.sections.head.text, 'one X pony', + 'new text present'); Helpers.dom.insertText(editor, 'Y'); - assert.hasElement('#editor p:contains(one XY pony)', - 'cursor positioned correctly'); + assert.equal(editor.post.sections.head.text, 'one XY pony', + 'further new text present'); }); test('selecting all text across sections and hitting enter deletes and moves cursor to empty section', (assert) => {