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

Skip to content

Commit ea89521

Browse files
committed
fix(test): improve $cookie service test to work with Safari 5.1
the max size for safari cookies has changed sligtly so I had to adjust the test to make cookie creation fail on this browser
1 parent 90ca6f9 commit ea89521

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/BrowserSpecs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,17 @@ describe('browser', function(){
377377
it('should log warnings when 4kb per cookie storage limit is reached', function() {
378378
var i, longVal = '', cookieStr;
379379

380-
for(i=0; i<4092; i++) {
380+
for(i=0; i<4091; i++) {
381381
longVal += '+';
382382
}
383383

384384
cookieStr = document.cookie;
385-
browser.cookies('x', longVal); //total size 4094-4096, so it should go through
385+
browser.cookies('x', longVal); //total size 4093-4096, so it should go through
386386
expect(document.cookie).not.toEqual(cookieStr);
387387
expect(browser.cookies()['x']).toEqual(longVal);
388388
expect(logs.warn).toEqual([]);
389389

390-
browser.cookies('x', longVal + 'xxx'); //total size 4097-4099, a warning should be logged
390+
browser.cookies('x', longVal + 'xxxx'); //total size 4097-4099, a warning should be logged
391391
expect(logs.warn).toEqual(
392392
[[ "Cookie 'x' possibly not set or overflowed because it was too large (4097 > 4096 " +
393393
"bytes)!" ]]);

0 commit comments

Comments
 (0)