2
2
3
3
/**
4
4
* @license angular-bootstrap-datetimepicker
5
- * (c) 2013 Knight Rider Consulting, Inc. http://www.knightrider.com
5
+ * Copyright 2013 Knight Rider Consulting, Inc. http://www.knightrider.com
6
6
* License: MIT
7
7
*/
8
8
12
12
* @since 7/21/13
13
13
*/
14
14
15
- describe ( 'current view displayed on the markup' , function ( ) {
15
+ describe ( 'current view displayed on the markup' , function ( ) {
16
16
'use strict' ;
17
17
18
- var $rootScope , element ;
18
+ var element ;
19
19
20
20
beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21
- beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
21
+ beforeEach ( inject ( function ( $compile , $rootScope ) {
22
22
moment . locale ( 'de' ) ;
23
- $rootScope = _$rootScope_ ;
24
23
$rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25
- element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
24
+ element = $compile ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26
25
$rootScope . $digest ( ) ;
27
26
} ) ) ;
28
27
@@ -33,13 +32,12 @@ describe('current view displayed on the markup', function(){
33
32
34
33
describe ( 'German day view with initial date of 2013-01-22' , function ( ) {
35
34
'use strict' ;
36
- var $rootScope , element ;
35
+ var element ;
37
36
beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
38
- beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
37
+ beforeEach ( inject ( function ( $compile , $rootScope ) {
39
38
moment . locale ( 'de' ) ;
40
- $rootScope = _$rootScope_ ;
41
39
$rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
42
- element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
40
+ element = $compile ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
43
41
$rootScope . $digest ( ) ;
44
42
} ) ) ;
45
43
it ( 'has `.switch` element with a value of 2013-1' , function ( ) {
@@ -62,12 +60,13 @@ describe('German day view with initial date of 2013-01-22', function () {
62
60
63
61
describe ( 'day with initial date of "2020-01-01T00:00:00.000" and minView="day"' , function ( ) {
64
62
'use strict' ;
65
- var $rootScope , element ;
63
+ var rootScope ;
64
+ var element ;
66
65
beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
67
- beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
68
- $ rootScope = _$rootScope_ ;
66
+ beforeEach ( inject ( function ( $compile , $rootScope ) {
67
+ rootScope = $rootScope ;
69
68
$rootScope . date = moment ( '2020-01-01T00:00:00.000' ) . toDate ( ) ;
70
- element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\', minView: \'day\' }" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
69
+ element = $compile ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\', minView: \'day\' }" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
71
70
$rootScope . $digest ( ) ;
72
71
} ) ) ;
73
72
it ( 'clicking the 13th `.day` element will set the date value to 2020-01-11T00:00:00.000"' , function ( ) {
@@ -80,20 +79,20 @@ describe('day with initial date of "2020-01-01T00:00:00.000" and minView="day"',
80
79
selectedElement . trigger ( 'click' ) ;
81
80
82
81
expect ( jQuery ( '.active' , element ) . text ( ) ) . toBe ( '12' ) ;
83
- expect ( $ rootScope. date ) . toEqual ( moment ( '2020-01-12T00:00:00.000' ) . toDate ( ) ) ;
82
+ expect ( rootScope . date ) . toEqual ( moment ( '2020-01-12T00:00:00.000' ) . toDate ( ) ) ;
84
83
} ) ;
85
84
} ) ;
86
85
87
86
88
-
89
87
describe ( 'day with initial date of "2008-02-01T00:00:00.000" (leap year) and minView="day"' , function ( ) {
90
88
'use strict' ;
91
- var $rootScope , element ;
89
+ var rootScope ;
90
+ var element ;
92
91
beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
93
- beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
94
- $ rootScope = _$rootScope_ ;
92
+ beforeEach ( inject ( function ( $compile , $rootScope ) {
93
+ rootScope = $rootScope ;
95
94
$rootScope . date = moment ( '2008-02-01T00:00:00.000' ) . toDate ( ) ;
96
- element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\', minView: \'day\' }" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
95
+ element = $compile ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\', minView: \'day\' }" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
97
96
$rootScope . $digest ( ) ;
98
97
} ) ) ;
99
98
it ( 'clicking the 33rd `.day` element will set the date value to 2008-29-11T00:00:00.000"' , function ( ) {
@@ -109,6 +108,6 @@ describe('day with initial date of "2008-02-01T00:00:00.000" (leap year) and min
109
108
110
109
selectedElement . trigger ( 'click' ) ;
111
110
expect ( jQuery ( '.active' , element ) . text ( ) ) . toBe ( '29' ) ;
112
- expect ( $ rootScope. date ) . toEqual ( moment ( '2008-02-29T00:00:00.000' ) . toDate ( ) ) ;
111
+ expect ( rootScope . date ) . toEqual ( moment ( '2008-02-29T00:00:00.000' ) . toDate ( ) ) ;
113
112
} ) ;
114
113
} ) ;
0 commit comments