1
1
'use strict' ;
2
2
3
3
describe ( 'ui-select tests' , function ( ) {
4
- var scope , $rootScope , $compile , $timeout , $injector , $q , uisRepeatParser , $exceptionHandler ;
4
+ var scope , $rootScope , $compile , $timeout , $injector , $q , uisRepeatParser ;
5
5
6
6
var Key = {
7
7
Enter : 13 ,
@@ -78,14 +78,13 @@ describe('ui-select tests', function() {
78
78
} ) ;
79
79
} ) ;
80
80
81
- beforeEach ( inject ( function ( _$rootScope_ , _$compile_ , _$timeout_ , _$injector_ , _$q_ , _uisRepeatParser_ , _$exceptionHandler_ ) {
81
+ beforeEach ( inject ( function ( _$rootScope_ , _$compile_ , _$timeout_ , _$injector_ , _$q_ , _uisRepeatParser_ ) {
82
82
$rootScope = _$rootScope_ ;
83
83
scope = $rootScope . $new ( ) ;
84
84
$compile = _$compile_ ;
85
85
$timeout = _$timeout_ ;
86
86
$injector = _$injector_ ;
87
87
$q = _$q_ ;
88
- $exceptionHandler = _$exceptionHandler_ ;
89
88
uisRepeatParser = _uisRepeatParser_ ;
90
89
scope . selection = { } ;
91
90
@@ -1111,53 +1110,6 @@ describe('ui-select tests', function() {
1111
1110
} ) ;
1112
1111
} ) ;
1113
1112
1114
-
1115
- it ( 'should throw when no ui-select-choices found' , function ( ) {
1116
- compileTemplate (
1117
- '<ui-select ng-model="selection.selected"> \
1118
- <ui-select-match></ui-select-match> \
1119
- </ui-select>'
1120
- ) ;
1121
- var lastError = $exceptionHandler . errors [ $exceptionHandler . errors . length - 1 ] ;
1122
- var expectedError = new Error ( '[ui.select:transcluded] Expected 1 .ui-select-choices but got \'0\'.' ) ;
1123
- expect ( lastError ) . toEqual ( expectedError ) ;
1124
- } ) ;
1125
-
1126
- it ( 'should throw when no repeat attribute is provided to ui-select-choices' , function ( ) {
1127
- compileTemplate (
1128
- '<ui-select ng-model="selection.selected"> \
1129
- <ui-select-match></ui-select-match> \
1130
- <ui-select-choices></ui-select-choices> \
1131
- </ui-select>'
1132
- ) ;
1133
- var lastError = $exceptionHandler . errors [ $exceptionHandler . errors . length - 1 ] ;
1134
- var expectedError = new Error ( '[ui.select:repeat] Expected \'repeat\' expression.' ) ;
1135
- expect ( lastError ) . toEqual ( expectedError ) ;
1136
- } ) ;
1137
-
1138
- it ( 'should throw when repeat attribute has incorrect format ' , function ( ) {
1139
- compileTemplate (
1140
- '<ui-select ng-model="selection.selected"> \
1141
- <ui-select-match></ui-select-match> \
1142
- <ui-select-choices repeat="incorrect format people"></ui-select-choices> \
1143
- </ui-select>'
1144
- ) ;
1145
- var lastError = $exceptionHandler . errors [ $exceptionHandler . errors . length - 1 ] ;
1146
- var expectedError = new Error ( '[ui.select:iexp] Expected expression in form of \'_item_ in _collection_[ track by _id_]\' but got \'incorrect format people\'.' ) ;
1147
- expect ( lastError ) . toEqual ( expectedError ) ;
1148
- } ) ;
1149
-
1150
- it ( 'should throw when no ui-select-match found' , function ( ) {
1151
- compileTemplate (
1152
- '<ui-select ng-model="selection.selected"> \
1153
- <ui-select-choices repeat="item in items"></ui-select-choices> \
1154
- </ui-select>'
1155
- ) ;
1156
- var lastError = $exceptionHandler . errors [ $exceptionHandler . errors . length - 1 ] ;
1157
- var expectedError = new Error ( '[ui.select:transcluded] Expected 1 .ui-select-match but got \'0\'.' ) ;
1158
- expect ( lastError ) . toEqual ( expectedError ) ;
1159
- } ) ;
1160
-
1161
1113
it ( 'should format the model correctly using alias' , function ( ) {
1162
1114
var el = compileTemplate (
1163
1115
'<ui-select ng-model="selection.selected"> \
@@ -3231,12 +3183,12 @@ describe('ui-select tests', function() {
3231
3183
expect ( el . scope ( ) . $select . spinnerClass ) . toBe ( 'randomclass' ) ;
3232
3184
} ) ;
3233
3185
} ) ;
3234
-
3186
+
3235
3187
describe ( 'With refresh on active' , function ( ) {
3236
3188
it ( 'should refresh when is activated' , function ( ) {
3237
3189
scope . fetchFromServer = function ( ) { } ;
3238
3190
var el = createUiSelect ( { refresh :"fetchFromServer($select.search)" , refreshDelay :0 } ) ;
3239
- spyOn ( scope , 'fetchFromServer' ) ;
3191
+ spyOn ( scope , 'fetchFromServer' ) ;
3240
3192
expect ( el . scope ( ) . $select . open ) . toEqual ( false ) ;
3241
3193
el . scope ( ) . $select . activate ( ) ;
3242
3194
$timeout . flush ( ) ;
@@ -3248,7 +3200,7 @@ describe('ui-select tests', function() {
3248
3200
it ( 'should refresh when open is set to true' , function ( ) {
3249
3201
scope . fetchFromServer = function ( ) { } ;
3250
3202
var el = createUiSelect ( { refresh :"fetchFromServer($select.search)" , refreshDelay :0 } ) ;
3251
- spyOn ( scope , 'fetchFromServer' ) ;
3203
+ spyOn ( scope , 'fetchFromServer' ) ;
3252
3204
expect ( el . scope ( ) . $select . open ) . toEqual ( false ) ;
3253
3205
openDropdown ( el ) ;
3254
3206
$timeout . flush ( ) ;
0 commit comments