-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
60 lines (42 loc) · 2.08 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.3/jasmine.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.3/jasmine.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.3/jasmine-html.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.3/boot.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-mocks.js"></script>
<script src="angular-carousel.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-touch.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-route.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-sanitize.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js"></script>
<script src="app.js"></script>
</head>
<body>
</body>
<script type="text/javascript">
describe('giphyAPIcall', function () {
var giphyAPIcall, httpBackend;
beforeEach(function () {
module('DemoApp');
inject(function ($httpBackend, _giphyAPIcall_) {
giphyAPIcall = _giphyAPIcall_;
httpBackend = $httpBackend;
});
});
it('Checking giphy API call', function () {
var returnData = {};
var testQuery = "enter keyword to test here";
httpBackend.expectGET("http://api.giphy.com/v1/gifs/search?q="+testQuery+"&api_key=nW5kH08e33troZ0wcdS4ywSLg9KyoIMb&limit=3").respond(returnData);
var returnedPromise = giphyAPIcall.get(testQuery);
var result;
returnedPromise.then(function (response) {
result = response.data;
});
httpBackend.flush();
expect(result).toEqual(returnData);
});
});
</script>
</html>