Followup r86622: add initial QUnit test cases for jquery.textSelection module.
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 23 Jul 2011 00:44:00 +0000 (00:44 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 23 Jul 2011 00:44:00 +0000 (00:44 +0000)
commite072a049037505e4fac65d0fe008a289c9c33bf2
tree83801299552e38ada1d85ba5fa74812d22728069
parent4b37e2acee2140a50d8e3b968814d1c30b312338
Followup r86622: add initial QUnit test cases for jquery.textSelection module.

* tests .textSelection()'s encapsulateText method mostly (also uses setSelection, getContents, and getSelection)
* examples from WikiEditor toolbar: sig, bold, h2 (ownline), ulist (ownline & splitlines)
* confirms that splitlines works more or less as expected, at least for basic single-line, single split-line, and multi-line cases

Doesn't test the WikiEditor iframe mode since that's in a separate extension; when it's possible to test those things too, that'll need to be run there.

One of the h2 tests fails in IE6, returning selected text that's offset by one character from what's expected. I'm not sure whether it's actually selecting the wrong text or whether it's returning the wrong text -- needs further investigation.

Also note that there's no setContents submethod in textSelection, despite there being some notes about one.
tests/qunit/index.html
tests/qunit/suites/resources/jquery/jquery.textSelection.js [new file with mode: 0644]