OLD | NEW |
---|---|
1 description("Test that collapseToStart() and collapseToEnd() throw INVALID_STATE _ERR if no selection is made."); | 1 description("Test that collapseToStart() and collapseToEnd() throw INVALID_STATE _ERR if no selection is made."); |
2 | 2 |
3 var sel = window.getSelection(); | 3 var sel = window.getSelection(); |
4 var textNode = document.createTextNode("abcdef"); | 4 var textNode = document.createTextNode("abcdef"); |
5 document.body.appendChild(textNode); | 5 document.body.appendChild(textNode); |
6 | 6 |
7 shouldThrow("sel.collapseToStart()", "'InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable.'"); | 7 shouldThrow("sel.collapseToStart()"); |
arv (Not doing code reviews)
2013/08/13 13:57:31
Why don't you want to test the message any more?
Mike West
2013/08/13 14:00:17
Laziness?
I realized that `shouldThrow` will outp
arv (Not doing code reviews)
2013/08/13 14:07:49
I thought as much.
The problem is that we will en
Mike West
2013/08/13 14:09:20
That's a fair point. Hrm.
Ok. I'll attempt to ove
| |
8 shouldThrow("sel.collapseToEnd()", "'InvalidStateError: An attempt was made to u se an object that is not, or is no longer, usable.'"); | 8 shouldThrow("sel.collapseToEnd()"); |
9 | 9 |
10 sel.selectAllChildren(textNode); | 10 sel.selectAllChildren(textNode); |
11 | 11 |
12 shouldBe("sel.collapseToStart()", "undefined"); | 12 shouldBe("sel.collapseToStart()", "undefined"); |
13 shouldBe("sel.collapseToEnd()", "undefined"); | 13 shouldBe("sel.collapseToEnd()", "undefined"); |
14 | 14 |
15 document.body.removeChild(textNode); | 15 document.body.removeChild(textNode); |
OLD | NEW |