@@ -151,6 +151,60 @@ describe('$compile', function() {
151
151
152
152
describe ( 'configuration' , function ( ) {
153
153
154
+ it ( 'should allow aHrefSanitizationWhitelist to be configured' , function ( ) {
155
+ module ( function ( $compileProvider ) {
156
+ expect ( $compileProvider . aHrefSanitizationWhitelist ( ) ) . toEqual ( / ^ \s * ( h t t p s ? | f t p | m a i l t o | t e l | f i l e ) : / ) ; // the default
157
+ $compileProvider . aHrefSanitizationWhitelist ( / o t h e r / ) ;
158
+ expect ( $compileProvider . aHrefSanitizationWhitelist ( ) ) . toEqual ( / o t h e r / ) ;
159
+ } ) ;
160
+ inject ( ) ;
161
+ } ) ;
162
+
163
+ it ( 'should allow debugInfoEnabled to be configured' , function ( ) {
164
+ module ( function ( $compileProvider ) {
165
+ expect ( $compileProvider . debugInfoEnabled ( ) ) . toBe ( true ) ; // the default
166
+ $compileProvider . debugInfoEnabled ( false ) ;
167
+ expect ( $compileProvider . debugInfoEnabled ( ) ) . toBe ( false ) ;
168
+ } ) ;
169
+ inject ( ) ;
170
+ } ) ;
171
+
172
+ it ( 'should allow preAssignBindingsEnabled to be configured' , function ( ) {
173
+ module ( function ( $compileProvider ) {
174
+ expect ( $compileProvider . preAssignBindingsEnabled ( ) ) . toBe ( true ) ; // the default
175
+ $compileProvider . preAssignBindingsEnabled ( false ) ;
176
+ expect ( $compileProvider . preAssignBindingsEnabled ( ) ) . toBe ( false ) ;
177
+ } ) ;
178
+ inject ( ) ;
179
+ } ) ;
180
+
181
+ it ( 'should allow onChangesTtl to be configured' , function ( ) {
182
+ module ( function ( $compileProvider ) {
183
+ expect ( $compileProvider . onChangesTtl ( ) ) . toBe ( 10 ) ; // the default
184
+ $compileProvider . onChangesTtl ( 2 ) ;
185
+ expect ( $compileProvider . onChangesTtl ( ) ) . toBe ( 2 ) ;
186
+ } ) ;
187
+ inject ( ) ;
188
+ } ) ;
189
+
190
+ it ( 'should allow commentDirectivesEnabled to be configured' , function ( ) {
191
+ module ( function ( $compileProvider ) {
192
+ expect ( $compileProvider . commentDirectivesEnabled ( ) ) . toBe ( true ) ; // the default
193
+ $compileProvider . commentDirectivesEnabled ( false ) ;
194
+ expect ( $compileProvider . commentDirectivesEnabled ( ) ) . toBe ( false ) ;
195
+ } ) ;
196
+ inject ( ) ;
197
+ } ) ;
198
+
199
+ it ( 'should allow cssClassDirectivesEnabled to be configured' , function ( ) {
200
+ module ( function ( $compileProvider ) {
201
+ expect ( $compileProvider . cssClassDirectivesEnabled ( ) ) . toBe ( true ) ; // the default
202
+ $compileProvider . cssClassDirectivesEnabled ( false ) ;
203
+ expect ( $compileProvider . cssClassDirectivesEnabled ( ) ) . toBe ( false ) ;
204
+ } ) ;
205
+ inject ( ) ;
206
+ } ) ;
207
+
154
208
it ( 'should register a directive' , function ( ) {
155
209
module ( function ( ) {
156
210
directive ( 'div' , function ( log ) {
0 commit comments