-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Calendar rebase #1316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calendar rebase #1316
Changes from 1 commit
0f431a6
6d393ea
2925e71
69736ca
a6bc8b9
b7f5d13
6fc0e99
d8cff5e
03a26ff
d443def
1c33a3a
57d86fc
6e57cdd
f980cb8
a66a8c5
e32c4a7
34c1a32
c649c85
c34f013
5182ba5
338baee
a7412cf
9cba180
fde83f2
6a1e8bc
5a6596d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Improve render day cell mechanism.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,11 +70,13 @@ test( "value", function() { | |
| }); | ||
|
|
||
| test( "valueAsDate", function() { | ||
| expect( 6 ); | ||
| expect( 13 ); | ||
|
|
||
| var input = TestHelpers.datepicker.init( "#datepicker" ), | ||
| var minDate, maxDate, dateAndTimeToSet, dateAndTimeClone, | ||
| input = TestHelpers.datepicker.init( "#datepicker" ), | ||
| picker = input.datepicker( "widget" ), | ||
| date1 = new Date( 2008, 6 - 1, 4 ); | ||
| date1 = new Date( 2008, 6 - 1, 4 ), | ||
| date2 = new Date(); | ||
|
|
||
| input.datepicker( "valueAsDate", new Date( 2014, 0, 1 ) ); | ||
| equal( input.val(), "1/1/14", "Input's value set" ); | ||
|
|
@@ -90,6 +92,36 @@ test( "valueAsDate", function() { | |
| ok(input.datepicker( "valueAsDate" ) === null, "Set date - default" ); | ||
| input.datepicker( "valueAsDate", date1 ); | ||
| TestHelpers.datepicker.equalsDate(input.datepicker( "valueAsDate" ), date1, "Set date - 2008-06-04" ); | ||
|
|
||
| // With minimum/maximum | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block of min/max tests seems to duplicate calendar's tests.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. This should be changed. Problem is it's much easier to test this in Datepicker as it has a isValid method. In Calendar I need to check if the selected value has changed even if it shouldn't.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok. Datepicker uses calendar's
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's okay to use the private method via the widget instance this seems like a good idea! So, remove the tests from datepicker completely (or leave one test to make sure the interaction works fine) and use _isValid in calendars tests?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmmm. This applies to more options than
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Just checking if the value is passed correctly into _setOption method?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, just retrieve the instance and ensure the option transferred. I'm not sure there's actual value in that though.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| input = TestHelpers.datepicker.init( "#datepicker" ); | ||
| date1 = new Date( 2008, 1 - 1, 4 ); | ||
| date2 = new Date( 2008, 6 - 1, 4 ); | ||
| minDate = new Date( 2008, 2 - 1, 29 ); | ||
| maxDate = new Date( 2008, 3 - 1, 28 ); | ||
|
|
||
| input.val( "" ).datepicker( "option", { min: minDate } ).datepicker( "valueAsDate", date2 ); | ||
| TestHelpers.datepicker.equalsDate( input.datepicker( "valueAsDate" ), date2, "Set date min/max - value > min" ); | ||
|
|
||
| input.datepicker( "valueAsDate", date1 ); | ||
| TestHelpers.datepicker.equalsDate( input.datepicker( "valueAsDate" ), date2, "Set date min/max - value < min" ); | ||
|
|
||
| input.val( "" ).datepicker( "option", { max: maxDate, min: null } ).datepicker( "valueAsDate", date1 ); | ||
| TestHelpers.datepicker.equalsDate( input.datepicker( "valueAsDate" ), date1, "Set date min/max - value < max" ); | ||
|
|
||
| input.datepicker( "valueAsDate", date2 ); | ||
| TestHelpers.datepicker.equalsDate( input.datepicker( "valueAsDate" ), date1, "Set date min/max - value > max" ); | ||
|
|
||
| input.val( "" ).datepicker( "option", { min: minDate } ).datepicker( "valueAsDate", date1 ); | ||
| ok( input.datepicker( "valueAsDate" ) === null, "Set date min/max - value < min" ); | ||
|
|
||
| input.datepicker( "valueAsDate", date2 ); | ||
| ok( input.datepicker( "valueAsDate" ) === null, "Set date min/max - value > max" ); | ||
|
|
||
| dateAndTimeToSet = new Date( 2008, 3 - 1, 28, 1, 11, 0 ); | ||
| dateAndTimeClone = new Date( 2008, 3 - 1, 28, 1, 11, 0 ); | ||
| input.datepicker( "valueAsDate", dateAndTimeToSet ); | ||
| equal( dateAndTimeToSet.getTime(), dateAndTimeClone.getTime(), "Date object passed should not be changed by valueAsDate" ); | ||
| }); | ||
|
|
||
| test( "isValid", function() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine leaving this one in as a TODO until we figure out what we want to do.