tests for jquery.highlightText
[lhc/web/wiklou.git] / tests / qunit / suites / resources / jquery / jquery.highlightText.test.js
1 module( 'jquery.highlightText' );
2
3 test( '-- Initial check', function() {
4 expect(1);
5 ok( $.fn.highlightText, 'jQuery.fn.highlightText defined' );
6 } );
7
8 test( 'Check', function() {
9 expect(3);
10 var $fixture;
11
12 $fixture = $( '<p>Blue Öyster Cult</p>' );
13 $fixture.highlightText( 'Blue' );
14 equal(
15 '<span class="highlight">Blue</span> Öyster Cult',
16 $fixture.html()
17 );
18
19 $fixture = $( '<p>Österreich</p>' );
20 $fixture.highlightText( 'Österreich' );
21 equal(
22 '<span class="highlight">Österreich</span>',
23 $fixture.html()
24 );
25
26 /**
27 * Highlighter broken on punctuation mark.
28 */
29 /**
30 $fixture = $( '<p>So good. To be there</p>' );
31 $fixture.highlightText( 'good' );
32 equal(
33 'So <span class="highlight">good</span>. To be there',
34 $fixture.html()
35 );
36 */
37 } );