Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5703984

Browse files
committed
test(jsonp): fixing jsonp e2e tests
- buzz api keeps on throttling our requests which makes our build fail so I'm disabling the buzz demo e2e test - the $xhr service jsonp test was modified to use jsonp on angularjs.org instead of buzz api for the same reason as mentioned above
1 parent ea89521 commit 5703984

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/content/cookbook/buzz.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ to retrieve Buzz activity and comments.
5353
</div>
5454
</doc:source>
5555
<doc:scenario>
56-
it('fetch buzz and expand', function() {
56+
xit('fetch buzz and expand', function() {
5757
element(':button:contains(fetch)').click();
5858
expect(repeater('div.buzz').count()).toBeGreaterThan(0);
5959
element('.buzz a:contains(Expand replies):first').click();

src/service/xhr.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@
145145
<input type="text" name="url" value="index.html" size="80"/>
146146
<button ng:click="fetch()">fetch</button><br>
147147
<button ng:click="updateModel('GET', 'index.html')">Sample GET</button>
148-
<button ng:click="updateModel('JSON', 'https://www.googleapis.com/buzz/v1/activities/googlebuzz/@self?alt=json&callback=JSON_CALLBACK')">Sample JSONP (Buzz API)</button>
149-
<button ng:click="updateModel('JSON', 'https://www.invalid_JSONP_request.com&callback=JSON_CALLBACK')">Invalid JSONP</button>
148+
<button ng:click="updateModel('JSON', 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">Sample JSONP</button>
149+
<button ng:click="updateModel('JSON', 'http://angularjs.org/doesntexist&callback=JSON_CALLBACK')">Invalid JSONP</button>
150150
<pre>code={{code}}</pre>
151151
<pre>response={{response}}</pre>
152152
</div>
@@ -159,11 +159,11 @@
159159
expect(binding('response')).toMatch(/angularjs.org/);
160160
});
161161
162-
it('should make JSONP request to the Buzz API', function() {
163-
element(':button:contains("Buzz API")').click();
162+
it('should make JSONP request to the angularjs.org', function() {
163+
element(':button:contains("Sample JSONP")').click();
164164
element(':button:contains("fetch")').click();
165165
expect(binding('code')).toBe('code=200');
166-
expect(binding('response')).toMatch(/buzz-feed/);
166+
expect(binding('response')).toMatch(/Super Hero!/);
167167
});
168168
169169
it('should make JSONP request to invalid URL and invoke the error handler',

0 commit comments

Comments
 (0)