Skip to content

Commit

Permalink
typeSettings test
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 13, 2018
1 parent 8006590 commit f6a32c9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/unit/controllers/remoteProjectManagerControllerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ describe('controller: RemoteProjectManagerController', function () {
expect(scope.deleteRemoteProjectManager).toBeDefined();
expect(typeof scope.deleteRemoteProjectManager).toEqual('function');
});
it('typeSettings should be defined', function () {
expect(scope.typeSettings).toBeDefined();
expect(typeof scope.typeSettings).toEqual('function');
});
});

describe('Do the scope methods work as expected', function () {
Expand Down Expand Up @@ -205,6 +209,37 @@ describe('controller: RemoteProjectManagerController', function () {
expect(scope.cancelDeleteRemoteProjectManager).toHaveBeenCalled();
});

it('typeSettings should return appropriate scaffold', function () {
var scaffold = [{
"type": "text",
"key": "url",
"gloss": "URL",
"visible": true
}, {
"type": "text",
"key": "username",
"gloss": "Username",
"visible": false
}, {
"type": "password",
"key": "password",
"gloss": "Password",
"visible": false
}, {
"type": "password",
"key": "token",
"gloss": "Token",
"visible": false
}];
scope.serviceTypes = [{
"gloss": "Version One",
"scaffold": scaffold,
"value": "VERSION_ONE"
}];
var typeSettings = scope.typeSettings('VERSION_ONE');
expect(typeSettings).toEqual(scaffold);
});

});

});

0 comments on commit f6a32c9

Please sign in to comment.