Skip to content

Commit

Permalink
test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
helen-dikareva committed Apr 11, 2018
1 parent 73ee44a commit 4a8ec08
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/client/fixtures/sandbox/selection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ asyncTest('Focus should not be called during setting selection if conteneditable
});

asyncTest('Focus should not be called during setting selection if editable element has been already focused (TestCafe GH - 2301)', function () {
var input = createTestInput('text', 'some text');
var focused = false;
var startPos = 1;
var endPos = 3;
var input = createTestInput('text', 'some text');
var focused = false;
var shouldBeFocused = browserUtils.isIE11 || browserUtils.isMSEdge || browserUtils.isSafari;
var startPos = 1;
var endPos = 3;

var isSelectionSet = function () {
strictEqual(input.selectionStart, startPos);
Expand All @@ -147,7 +148,7 @@ asyncTest('Focus should not be called during setting selection if editable eleme
input.setSelectionRange(startPos, endPos);

window.setTimeout(function () {
strictEqual(focused, browserUtils.isIE11);
strictEqual(focused, shouldBeFocused);
isSelectionSet();

input.focus();
Expand Down

0 comments on commit 4a8ec08

Please sign in to comment.