Skip to content

Commit 6f23745

Browse files
harm-lessharm-less
authored andcommitted
Fixed the specs
1 parent 017bf0e commit 6f23745

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

tests/angular-sticky.spec.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -336,21 +336,18 @@ describe('angular-ui-router-css', function() {
336336
})
337337
});
338338

339-
it('cannot find "betsol-load-stylesheet"', function(done) {
339+
it('cannot find "betsol-load-stylesheet"', function() {
340340
var loadStylesheet = window.loadStylesheet;
341341
window.loadStylesheet = null;
342342

343-
$state.defaultErrorHandler(function(error) {
344-
expect(error.detail.message).toBe('Error "angular-ui-router-css": Package "betsol-load-stylesheet" must be loaded before you can use "angular-ui-router-css"');
343+
addState('test', 'foo.css');
345344

346-
// restore the "betsol-load-stylesheet" method
347-
window.loadStylesheet = loadStylesheet;
345+
expect(function() {
346+
stateGo('test');
347+
}).toThrow(new Error('Error "angular-ui-router-css": Package "betsol-load-stylesheet" must be loaded before you can use "angular-ui-router-css"'));
348348

349-
done();
350-
});
351-
352-
addState('test', 'foo.css');
353-
stateGo('test');
349+
// restore the "betsol-load-stylesheet" method
350+
window.loadStylesheet = loadStylesheet;
354351
});
355352
});
356353

@@ -397,7 +394,7 @@ describe('angular-ui-router-css', function() {
397394
expect(getStyle('.test')).toBeUndefined();
398395

399396
done();
400-
}, 300);
397+
}, 100);
401398
});
402399

403400
it('inject a stylesheet and remove it afterwards with ui-css', function(done) {
@@ -410,7 +407,7 @@ describe('angular-ui-router-css', function() {
410407
removeHandler();
411408

412409
done();
413-
}, 300);
410+
}, 100);
414411
});
415412
});
416413
});

0 commit comments

Comments
 (0)