File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ describe ( "seoInterceptor" , function ( ) {
2+
3+ const seoInterceptorName = "seoInterceptor" ;
4+
5+ let seoInterceptor , httpProvider , httpBackend ;
6+ beforeEach ( angular . mock . module ( 'espackApp' , ( $httpProvider ) => {
7+ httpProvider = $httpProvider ;
8+ } ) ) ;
9+
10+ describe ( '#existence' , ( ) => {
11+
12+ beforeEach ( ( ) => {
13+ _inject ( ) ;
14+ } ) ;
15+
16+ it ( 'should be added to $http interceptors' , ( ) => {
17+
18+ var interceptorNames = httpProvider . interceptors
19+ . filter ( ( item ) => item . prototype . constructor . name === seoInterceptorName )
20+ . map ( ( item ) => item . prototype . constructor . name ) ;
21+
22+ expect ( interceptorNames . length ) . toEqual ( 1 ) ;
23+ expect ( interceptorNames ) . toEqual ( [ seoInterceptorName ] )
24+
25+ } ) ;
26+
27+ } ) ;
28+
29+ function _inject ( ) {
30+ inject ( ( $httpBackend ) => {
31+ httpBackend = $httpBackend ;
32+ } ) ;
33+ }
34+
35+ } ) ;
You can’t perform that action at this time.
0 commit comments