mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker tests: Work around encoding issues in oldIE.
This commit is contained in:
parent
8c36603305
commit
ccdceddd80
@ -132,16 +132,21 @@ test('beforeShowDay-getDate', function() {
|
|||||||
dp = $('#ui-datepicker-div');
|
dp = $('#ui-datepicker-div');
|
||||||
inp.val('01/01/2010').datepicker('show');
|
inp.val('01/01/2010').datepicker('show');
|
||||||
// contains non-breaking space
|
// 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
|
||||||
|
$( "<span>January 2010</span>" ).text(), 'Initial month');
|
||||||
$('a.ui-datepicker-next', dp).click();
|
$('a.ui-datepicker-next', dp).click();
|
||||||
$('a.ui-datepicker-next', dp).click();
|
$('a.ui-datepicker-next', dp).click();
|
||||||
// contains non-breaking space
|
// contains non-breaking space
|
||||||
equal($('div.ui-datepicker-title').text(), 'March 2010', 'After next clicks');
|
equal($('div.ui-datepicker-title').text(),
|
||||||
|
$( "<span>March 2010</span>" ).text(), 'After next clicks');
|
||||||
inp.datepicker('hide').datepicker('show');
|
inp.datepicker('hide').datepicker('show');
|
||||||
$('a.ui-datepicker-prev', dp).click();
|
$('a.ui-datepicker-prev', dp).click();
|
||||||
$('a.ui-datepicker-prev', dp).click();
|
$('a.ui-datepicker-prev', dp).click();
|
||||||
// contains non-breaking space
|
// contains non-breaking space
|
||||||
equal($('div.ui-datepicker-title').text(), 'November 2009', 'After prev clicks');
|
equal($('div.ui-datepicker-title').text(),
|
||||||
|
$( "<span>November 2009</span>" ).text(), 'After prev clicks');
|
||||||
inp.datepicker('hide');
|
inp.datepicker('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -146,7 +146,10 @@ test('otherMonths', function() {
|
|||||||
var inp = TestHelpers.datepicker.init('#inp'),
|
var inp = TestHelpers.datepicker.init('#inp'),
|
||||||
pop = $('#ui-datepicker-div');
|
pop = $('#ui-datepicker-div');
|
||||||
inp.val('06/01/2009').datepicker('show');
|
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
|
||||||
|
$( "<span>\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0</span>" ).text(),
|
||||||
'Other months - none');
|
'Other months - none');
|
||||||
ok(pop.find('td:last *').length === 0, 'Other months - no content');
|
ok(pop.find('td:last *').length === 0, 'Other months - no content');
|
||||||
inp.datepicker('hide').datepicker('option', 'showOtherMonths', true).datepicker('show');
|
inp.datepicker('hide').datepicker('option', 'showOtherMonths', true).datepicker('show');
|
||||||
@ -158,7 +161,10 @@ test('otherMonths', function() {
|
|||||||
'Other months - select');
|
'Other months - select');
|
||||||
ok(pop.find('td:last a').length === 1, 'Other months - link content');
|
ok(pop.find('td:last a').length === 1, 'Other months - link content');
|
||||||
inp.datepicker('hide').datepicker('option', 'showOtherMonths', false).datepicker('show');
|
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
|
||||||
|
$( "<span>\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0</span>" ).text(),
|
||||||
'Other months - none');
|
'Other months - none');
|
||||||
ok(pop.find('td:last *').length === 0, 'Other months - no content');
|
ok(pop.find('td:last *').length === 0, 'Other months - no content');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user