Skip to content

Commit

Permalink
Merge 201dd32 into 86714bb
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelwang48 committed Nov 26, 2016
2 parents 86714bb + 201dd32 commit 3394f1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/directives/adf-widget.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ angular.module('adf')
}
}
$element.remove();
$rootScope.$broadcast('adfWidgetRemovedFromColumn');
$rootScope.$broadcast('adfWidgetRemovedFromColumn', definition);
};

$scope.remove = function() {
Expand Down
10 changes: 10 additions & 0 deletions test/unit/directives/adf-widget.directive.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ describe('widget directive tests', function() {
// expect widget is not removed
expect($scope.column.widgets.length).toBe(1);
});

it('should broadcast event with the definition of the deleted', function() {
spyOn($rootScope, '$broadcast').and.returnValue({preventDefault: true});
$scope.options.enableConfirmDelete = false;
removeWidget();

var definition = jasmine.objectContaining($scope.column.widgets[0]);
expect($rootScope.$broadcast).toHaveBeenCalledWith('adfWidgetRemovedFromColumn', definition);
});

});

it('should open and close full screen dialog', function() {
Expand Down

0 comments on commit 3394f1e

Please sign in to comment.