Skip to content

Commit

Permalink
FIXED: Compatibility of remove tests with new JSRobot.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Sutton committed Nov 22, 2010
1 parent 4216188 commit 4321396
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions tests/remove.html
Expand Up @@ -28,7 +28,7 @@
editor.execCommand('undo', false, null);
equals(editor.getContent(), originalContent, 'Undo deletion');
QUnit.start();
});
}, editor.selection.getNode());
});

// oncut is not supported by FireFox 2.0 so this is impossible to fix there.
Expand All @@ -42,15 +42,18 @@
editor.focus();
setSelection('p:nth-child(1)', 4, 'p:nth-child(2)', 4);
robot.cut(function() {
equals(editor.getContent(), "<p>Line2</p>", 'Cut text');
editor.execCommand('undo', false, null);
equals(editor.getContent(), originalContent, 'Undo cut');
editor.execCommand('SelectAll');
robot.paste(function() {
ok(/Line/.test(editor.getContent()), 'Content should have been on clipboard. Got: ' + editor.getContent());
QUnit.start();
});
});
// The fix for this bug happens in a timeout after cut so we need to make sure that happens first by adding an additional delay.
setTimeout(function() {
equals(editor.getContent(), "<p>Line2</p>", 'Cut text');
editor.execCommand('undo', false, null);
equals(editor.getContent(), originalContent, 'Undo cut');
editor.execCommand('SelectAll');
robot.paste(function() {
ok(/Line/.test(editor.getContent()), 'Content should have been on clipboard. Got: ' + editor.getContent());
QUnit.start();
}, editor.selection.getNode());
}, 100);
}, editor.selection.getNode());
});
} else {
test('Skipped on FireFox 2.x: Cut with indented text', function() {});
Expand All @@ -69,7 +72,7 @@
editor.execCommand('undo', false, null);
equals(editor.getContent(), originalContent, 'Undo deletion');
QUnit.start();
});
}, editor.selection.getNode());
});

asyncTest('Forward delete with first paragraph indented', function() {
Expand All @@ -83,7 +86,7 @@
robot.forwardDelete(function() {
equals(editor.getContent(), '<p style="margin-left: 30px;">Line2</p>', 'Delete content');
QUnit.start();
});
}, editor.selection.getNode());
});

tinyMCE.init({
Expand Down

0 comments on commit 4321396

Please sign in to comment.