Skip to content

Commit

Permalink
Fix gate-check, e2e todo
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Jan 18, 2018
1 parent d0a0e19 commit 53af3cf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@
* @description restart an application
* @param {string} cnsiGuid - The GUID of the cloud-foundry server.
* @param {string} guid - the application id
* @returns {promise} a promise object
* @public
*/
function restartApp(cnsiGuid, guid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
describe('service-card directive', function () {
var $compile, $httpBackend, $scope, mockBindingsApi, cfServiceInstanceService;
var APP_GUID = '6e23689c-2844-4ebf-ab69-e52ab3439f6b';
var SERVICE_BINDING_GUID = '571b283b-97f9-41e3-abc7-81792ee34e40';
var SERVICE_NAME = 'instance_123';
var cnsiGuid = 'cnsiGuid';
var spaceGuid = 'spaceGuid';

Expand Down Expand Up @@ -91,26 +93,28 @@
serviceCardCtrl = element.controller('serviceCard');
});

it('detach', function () {
it('should call unbindServiceFromApp', function () {
spyOn(cfServiceInstanceService, 'unbindServiceFromApp');
serviceCardCtrl.detach({
entity: {
service_bindings: [{
entity: {
app_guid: APP_GUID
}
}]
}
});
expect(cfServiceInstanceService.unbindServiceFromApp)
.toHaveBeenCalled();
var args = cfServiceInstanceService.unbindServiceFromApp.calls.argsFor(0);
expect(args[0]).toBe('guid');
expect(args[1]).toBe('6e23689c-2844-4ebf-ab69-e52ab3439f6b');
expect(args[2]).toBe('571b283b-97f9-41e3-abc7-81792ee34e40');
expect(args[3]).toBe('instance_123');
it('should call unbindServiceFromApp', function () {
spyOn(cfServiceInstanceService, 'unbindServiceFromApp');
serviceCardCtrl.detach({
entity: {
name: SERVICE_NAME,
service_bindings: [{
metadata: {
guid: SERVICE_BINDING_GUID
},
entity: {
app_guid: APP_GUID
}
}]
}
});
expect(cfServiceInstanceService.unbindServiceFromApp)
.toHaveBeenCalled();
var args = cfServiceInstanceService.unbindServiceFromApp.calls.argsFor(0);
expect(args[0]).toBe('guid');
expect(args[1]).toBe('6e23689c-2844-4ebf-ab69-e52ab3439f6b');
expect(args[2]).toBe('571b283b-97f9-41e3-abc7-81792ee34e40');
expect(args[3]).toBe('instance_123');
});
});
});
Expand Down

0 comments on commit 53af3cf

Please sign in to comment.