hjg
2024-07-09 30304784e82d4bba24121328da8eb8490aec4f4f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module('Inline', {
    setup: function(){
        this.component = $('<div data-date="12-02-2012"></div>')
                        .appendTo('#qunit-fixture')
                        .datepicker({format: "dd-mm-yyyy"});
        this.dp = this.component.data('datepicker')
        this.picker = this.dp.picker;
    },
    teardown: function(){
        this.picker.remove();
    }
});
 
 
test('Picker gets date/viewDate from data-date attr', function(){
    datesEqual(this.dp.date, UTCDate(2012, 1, 12));
    datesEqual(this.dp.viewDate, UTCDate(2012, 1, 12));
});
 
 
test('Visible after init', function(){
    ok(this.picker.is(':visible'));
});
 
test('update', function(){
    this.dp.update('13-03-2012')
    datesEqual(this.dp.date, UTCDate(2012, 2, 13));
});