Skip to content

Commit 550ee66

Browse files
committed
add existence check test
1 parent fe006af commit 550ee66

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
});

0 commit comments

Comments
 (0)