From 3522a23b507f049a8917401bd6acaa928ae37ed8 Mon Sep 17 00:00:00 2001 From: Ca-Phun Ung Date: Mon, 22 Dec 2008 15:47:35 +0000 Subject: Datepicker #3647: added enable, disable, destroy buttons to visual test. Fixed failing localisation tests. Fixed RTL support and selected day highlighting for keyboard navigation. --- tests/datepicker.js | 10 ++++----- tests/visual/datepicker.html | 53 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/datepicker.js b/tests/datepicker.js index 71bbaa950..7ae71fc9e 100644 --- a/tests/datepicker.js +++ b/tests/datepicker.js @@ -423,6 +423,7 @@ test('enableDisable', function() { inp.datepicker('destroy'); // Inline var inl = init('#inl'); + var dp = $('.ui-datepicker-inline', inl); ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled'); ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover initially absent'); inl.datepicker('disable'); @@ -1185,24 +1186,21 @@ test('events', function() { test('localisation', function() { var inp = init('#inp', $.datepicker.regional['fr']); - inp.datepicker('option', {dateFormat: 'DD, d MM yy', showButtonPanel:true}).val('').datepicker('show'); + inp.datepicker('option', {dateFormat: 'DD, d MM yy', showButtonPanel:true, changeMonth:true, changeYear:true}).val('').datepicker('show'); var dp = $('#ui-datepicker-div'); equals($('.ui-datepicker-close', dp).text(), 'Fermer', 'Localisation - close'); $('.ui-datepicker-close', dp).simulate('mouseover'); equals($('.ui-datepicker-prev', dp).text(), '', 'Localisation - next'); - equals($('.ui-datepicker-current', dp).text(), 'Courant', 'Localisation - current'); var month = 0; - $('.ui-datepicker-new-month option', dp).each(function() { + $('.ui-datepicker-month option', dp).each(function() { equals($(this).text(), $.datepicker.regional['fr'].monthNames[month], 'Localisation - month ' + month); month++; }); - equals($('.ui-datepicker-calendar th:first', dp).text(), - $.datepicker.regional['fr'].weekHeader, 'Localisation - week header'); var day = 1; - $('.ui-datepicker-calendar th a', dp).each(function() { + $('.ui-datepicker-calendar th', dp).each(function() { equals($(this).text(), $.datepicker.regional['fr'].dayNamesMin[day], 'Localisation - day ' + day); day = (day + 1) % 7; diff --git a/tests/visual/datepicker.html b/tests/visual/datepicker.html index 214c2c8e5..34b85c86e 100644 --- a/tests/visual/datepicker.html +++ b/tests/visual/datepicker.html @@ -9,9 +9,50 @@ @@ -19,18 +60,30 @@