This repository has been archived by the owner on May 3, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 164
/
test.html
165 lines (159 loc) · 6.66 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>QUnit Example</title>
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.9.2.css">
<script src="https://code.jquery.com/qunit/qunit-2.9.2.js"></script>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<div style="display:none" id="instagram-feed1"></div>
<div style="display:none" id="instagram-feed2"></div>
<div style="display:none" id="instagram-feed3"></div>
<div style="display:none" id="instagram-feed4"></div>
<div style="display:none" id="instagram-feed5"></div>
<script src="jquery.instagramFeed.min.js"></script>
<script>
(function($){
$(window).on('load', function(){
QUnit.test("Test1", function( assert ) {
var failed = false;
try{
$.instagramFeed({
'username': 'instagram',
'container': "#instagram-feed1",
'display_profile': true,
'display_biography': true,
'display_gallery': true,
'display_captions': true,
'get_raw_json': false,
'callback': null,
'styling': true,
'items': 8,
'items_per_row': 4,
'margin': 1
});
}catch(e){
failed = true;
}
assert.ok(failed === false, "Passed Test1!");
});
QUnit.test("Test2", function( assert ) {
var failed = false;
try{
$.instagramFeed({
'username': 'github',
'container': "#instagram-feed2",
'display_profile': false,
'display_biography': false,
'display_gallery': true,
'display_captions': false,
'get_raw_json': false,
'callback': null,
'styling': true,
'items': 8,
'items_per_row': 4,
'margin': 1
});
}catch(e){
failed = true;
}
assert.ok(failed === false, "Passed Test2!");
});
QUnit.test("Test3", function( assert ) {
var failed = false;
try{
$.instagramFeed({
'username': 'zara',
'container': "#instagram-feed3",
'display_profile': false,
'display_biography': false,
'display_gallery': true,
'get_raw_json': false,
'callback': null,
'styling': true,
'items': 12,
'items_per_row': 6,
'margin': 0.25
});
}catch(e){
failed = true;
}
assert.ok(failed === false, "Passed Test3!");
});
QUnit.test("Test4", function( assert ) {
var failed = false;
try{
$.instagramFeed({
'username': 'fcbarcelona',
'container': "#instagram-feed4",
'display_profile': false,
'display_biography': false,
'display_gallery': false,
'display_igtv': true,
'get_raw_json': false,
'callback': null,
'styling': true,
'items': 8,
'items_per_row': 4,
'margin': 1
});
}catch(e){
failed = true;
}
assert.ok(failed === false, "Passed Test4!");
});
QUnit.test("Test5", function( assert ) {
var failed = false;
try{
$.instagramFeed({
'username': 'travisci',
'callback': function(json){
$('#instagram-feed5').html(json);
}
});
}catch(e){
failed = true;
}
assert.ok(failed === false, "Passed Test5!");
});
QUnit.test("Test6", function( assert ) {
var failed = false;
try{
$.instagramFeed({
'tag': 'paradise',
'container': "#instagram-feed4",
'display_profile': true,
'display_gallery': true,
'display_captions': true,
'items': 100,
'items_per_row': 5,
'margin': 0.5
});
}catch(e){
failed = true;
}
assert.ok(failed === false, "Passed Test6!");
});
QUnit.test("Test7", function( assert ) {
var status = $.instagramFeed({});
assert.ok(status === false, "Passed Test7 (no username nor tag)!");
});
QUnit.test("Test8", function( assert ) {
var status = $.instagramFeed({
"username": "travisci"
});
assert.ok(status === false, "Passed Test8! (no container nor callback)");
});
});
})(jQuery);
</script>
</body>
</html>