0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Fix tests by resetting the selection when selectAll is called

This commit is contained in:
Islam Sharabash 2016-08-22 12:59:51 -07:00
parent b2f0c42553
commit 082fb79fcd

View file

@ -26,6 +26,7 @@ describe('Squire RTE', function () {
}); });
function selectAll(editor) { function selectAll(editor) {
doc.getSelection().removeAllRanges()
var range = doc.createRange(); var range = doc.createRange();
range.setStart(doc.body.childNodes.item(0), 0); range.setStart(doc.body.childNodes.item(0), 0);
range.setEnd(doc.body.childNodes.item(0), doc.body.childNodes.item(0).childNodes.length); range.setEnd(doc.body.childNodes.item(0), doc.body.childNodes.item(0).childNodes.length);