"Krinkle" posted a comment on MediaWiki.r92923.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/92923#c30472

Commit summary for MediaWiki.r92923:

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.

Krinkle's comment:

<pre>
+               var $fixture = $('<div id="qunit-fixture"></div>');
+               var $textarea = $('<textarea>');
+
+               $fixture.append($textarea);
+               $('body').append($fixture);
</pre>

This was causing several <code><nowiki><div 
id="qunit-fixture"></div></nowiki></code> elements to be appended to the DOM 
and causing other tests to randomly fail due to ID conflicts. The QUnit test 
suite provides this by default, and when it doesn't it should atleast be 
removed/clean up after.

Fixed in r110717.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to