Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(toast): replace cancel with hide on hideDelay
Browse files Browse the repository at this point in the history
closes #3558
  • Loading branch information
cebor authored and rschmukler committed Jul 7, 2015
1 parent 7eefcfe commit 2b68713
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/components/toast/toast.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('$mdToast service', function() {
hasConfigMethods(['content', 'action', 'capsule', 'highlightAction', 'theme']);

it('supports a basic toast', inject(function($mdToast, $rootScope, $timeout, $animate) {
var rejected = false;
var resolved = false;
var parent = angular.element('<div>');
$mdToast.show(
$mdToast.simple({
Expand All @@ -25,8 +25,8 @@ describe('$mdToast service', function() {
theme: 'some-theme',
capsule: true
})
).catch(function() {
rejected = true;
).then(function() {
resolved = true;
});
$rootScope.$digest();
expect(parent.find('span').text()).toBe('Do something');
Expand All @@ -35,7 +35,7 @@ describe('$mdToast service', function() {
$animate.triggerCallbacks();
$timeout.flush();
$animate.triggerCallbacks();
expect(rejected).toBe(true);
expect(resolved).toBe(true);
}));

it('supports dynamicly updating the content', inject(function($mdToast, $rootScope, $rootElement) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/interimElement/interimElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function InterimElementProvider() {

function startHideTimeout() {
if (options.hideDelay) {
hideTimeout = $timeout(service.cancel, options.hideDelay) ;
hideTimeout = $timeout(service.hide, options.hideDelay) ;
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/interimElement/interimElement.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ describe('$$interimElement service', function() {
}));

it('calls hide after hideDelay', inject(function($animate, $timeout, $rootScope) {
var hideSpy = spyOn(Service, 'cancel').and.callThrough();
var hideSpy = spyOn(Service, 'hide').and.callThrough();
Service.show({hideDelay: 1000});
expect(hideSpy).toHaveBeenCalled();
}));
Expand Down

0 comments on commit 2b68713

Please sign in to comment.