From: Scott González Date: Thu, 15 Nov 2012 23:57:44 +0000 (-0500) Subject: Datepicker tests: Work around encoding issues in oldIE. X-Git-Tag: 1.10.0-beta.1~161 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ccdceddd804458ed451b11660c161ef3cf8de5cd;p=jquery-ui.git Datepicker tests: Work around encoding issues in oldIE. --- diff --git a/tests/unit/datepicker/datepicker_events.js b/tests/unit/datepicker/datepicker_events.js index 5e8a35e0d..43b0a4b23 100644 --- a/tests/unit/datepicker/datepicker_events.js +++ b/tests/unit/datepicker/datepicker_events.js @@ -132,16 +132,21 @@ test('beforeShowDay-getDate', function() { dp = $('#ui-datepicker-div'); inp.val('01/01/2010').datepicker('show'); // contains non-breaking space - equal($('div.ui-datepicker-title').text(), 'January 2010', 'Initial month'); + equal($('div.ui-datepicker-title').text(), + // support: IE <9, jQuery <1.8 + // In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways + $( "January 2010" ).text(), 'Initial month'); $('a.ui-datepicker-next', dp).click(); $('a.ui-datepicker-next', dp).click(); // contains non-breaking space - equal($('div.ui-datepicker-title').text(), 'March 2010', 'After next clicks'); + equal($('div.ui-datepicker-title').text(), + $( "March 2010" ).text(), 'After next clicks'); inp.datepicker('hide').datepicker('show'); $('a.ui-datepicker-prev', dp).click(); $('a.ui-datepicker-prev', dp).click(); // contains non-breaking space - equal($('div.ui-datepicker-title').text(), 'November 2009', 'After prev clicks'); + equal($('div.ui-datepicker-title').text(), + $( "November 2009" ).text(), 'After prev clicks'); inp.datepicker('hide'); }); diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js index 7d2b070fa..8b8888780 100644 --- a/tests/unit/datepicker/datepicker_options.js +++ b/tests/unit/datepicker/datepicker_options.js @@ -146,7 +146,10 @@ test('otherMonths', function() { var inp = TestHelpers.datepicker.init('#inp'), pop = $('#ui-datepicker-div'); inp.val('06/01/2009').datepicker('show'); - equal(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0', + equal(pop.find('tbody').text(), + // support: IE <9, jQuery <1.8 + // In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways + $( "\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0" ).text(), 'Other months - none'); ok(pop.find('td:last *').length === 0, 'Other months - no content'); inp.datepicker('hide').datepicker('option', 'showOtherMonths', true).datepicker('show'); @@ -158,7 +161,10 @@ test('otherMonths', function() { 'Other months - select'); ok(pop.find('td:last a').length === 1, 'Other months - link content'); inp.datepicker('hide').datepicker('option', 'showOtherMonths', false).datepicker('show'); - equal(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0', + equal(pop.find('tbody').text(), + // support: IE <9, jQuery <1.8 + // In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways + $( "\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0" ).text(), 'Other months - none'); ok(pop.find('td:last *').length === 0, 'Other months - no content'); });