{{product.name}} |
- {{product.remoteProjectManager.name}} |
- {{product.remoteProject.name}} |
- {{product.scopeId}} |
+
+
+
+ {{rpi.remoteProjectManager.name}}
+
+ |
+
+
+ {{getRemoteProjectByRemoteProjectInfo(rpi).name}}
+
+ |
+
+
+ |
diff --git a/app/views/management/remoteProjectManager.html b/app/views/management/remoteProjectManager.html
index d6d3202..b325422 100644
--- a/app/views/management/remoteProjectManager.html
+++ b/app/views/management/remoteProjectManager.html
@@ -10,7 +10,10 @@
| Actions |
- {{remoteProjectManager.name}} |
+
+
+ {{remoteProjectManager.name}}
+ |
{{remoteProjectManager.url}} |
diff --git a/app/views/modals/addProductModal.html b/app/views/modals/addProductModal.html
index 472c014..ced4b05 100644
--- a/app/views/modals/addProductModal.html
+++ b/app/views/modals/addProductModal.html
@@ -38,8 +38,12 @@ Create Product
- - {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}}
-
+
-
+ {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}}
+
+
+
+
diff --git a/app/views/modals/editProductModal.html b/app/views/modals/editProductModal.html
index 9798f75..6a6651e 100644
--- a/app/views/modals/editProductModal.html
+++ b/app/views/modals/editProductModal.html
@@ -39,8 +39,12 @@ Edit Product
- - {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}}
-
+
-
+ {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}}
+
+
+
+
diff --git a/tests/mock/model/mockProduct.js b/tests/mock/model/mockProduct.js
index d17ce81..513eb29 100644
--- a/tests/mock/model/mockProduct.js
+++ b/tests/mock/model/mockProduct.js
@@ -5,7 +5,7 @@ var dataProduct1 = {
remoteProjectManager: {
id: 1,
name: "Remote Project Manager 1",
- type: "VERSION_ONE",
+ type: "GITHUB_MILESTONE",
url: "url1",
token: "username1:password1"
},
@@ -18,8 +18,8 @@ var dataProduct2 = {
name: "Product 2",
remoteProjectInfo: [{
remoteProjectManager: {
- id: 1,
- name: "Remote Project Manager 1",
+ id: 2,
+ name: "Remote Project Manager 2",
type: "VERSION_ONE",
url: "url2",
token: "username2:password2"
@@ -35,7 +35,7 @@ var dataProduct3 = {
remoteProjectManager: {
id: 1,
name: "Remote Project Manager 1",
- type: "VERSION_ONE",
+ type: "GITHUB_MILESTONE",
url: "url1",
token: "username1:password1"
},
diff --git a/tests/mock/repo/mockRemoteProjectManagerRepo.js b/tests/mock/repo/mockRemoteProjectManagerRepo.js
index 9890045..7b9bc26 100644
--- a/tests/mock/repo/mockRemoteProjectManagerRepo.js
+++ b/tests/mock/repo/mockRemoteProjectManagerRepo.js
@@ -30,7 +30,5 @@ angular.module("mock.remoteProjectManagerRepo", []).service("RemoteProjectManage
return payloadPromise($q.defer());
};
- repo.getTypeScaffolding = function (type) {};
-
return repo;
});
diff --git a/tests/unit/controllers/productControllerTest.js b/tests/unit/controllers/productControllerTest.js
index 06ef2de..6d25612 100644
--- a/tests/unit/controllers/productControllerTest.js
+++ b/tests/unit/controllers/productControllerTest.js
@@ -99,6 +99,7 @@ describe("controller: ProductController", function () {
"confirmDeleteProduct",
"createProduct",
"deleteProduct",
+ "distinctRemoteProjectManagers",
"editProduct",
"getRemoteProjectByRemoteProjectInfo",
"getRemoteProjectManagerRemoteProjects",
@@ -208,6 +209,28 @@ describe("controller: ProductController", function () {
expect($scope.cancelDeleteProduct).toHaveBeenCalled();
});
+ it("distinctRemoteProjectManagers should return a distinct list", function () {
+ var response;
+ var rpis = [
+ {
+ scopeId: "0010",
+ remoteProjectManager: dataRemoteProjectManager1
+ },
+ {
+ scopeId: "0020",
+ remoteProjectManager: dataRemoteProjectManager2
+ },
+ {
+ scopeId: "0030",
+ remoteProjectManager: dataRemoteProjectManager1
+ }
+ ]
+
+ response = $scope.distinctRemoteProjectManagers(rpis);
+
+ expect(response.length).toEqual(2);
+ });
+
it("editProduct set the productToEdit and open the modal", function () {
spyOn($scope, "openModal");
diff --git a/tests/unit/directives/remoteProjectsIconDirective.js b/tests/unit/directives/remoteProjectsIconDirective.js
new file mode 100644
index 0000000..a783637
--- /dev/null
+++ b/tests/unit/directives/remoteProjectsIconDirective.js
@@ -0,0 +1,55 @@
+describe("directive: remoteProjectsIcon", function () {
+ var $compile, $q, $scope, directive, element;
+
+ var initializeVariables = function () {
+ inject(function (_$q_, _$compile_) {
+ $q = _$q_;
+ $compile = _$compile_;
+ });
+ };
+
+ var initializeDirective = function (settings) {
+ inject(function (_$rootScope_) {
+ $scope = _$rootScope_.$new();
+
+ var attr = settings && settings.attr ? settings.attr : "";
+ var body = settings && settings.body ? settings.body : "";
+
+ element = angular.element("" + body + "");
+ directive = $compile(element)($scope);
+
+ $scope.$digest();
+ });
+ };
+
+ beforeEach(function () {
+ module("core");
+ module("app");
+ module("templates");
+
+ installPromiseMatchers();
+ initializeVariables();
+ });
+
+ describe("Is the directive", function () {
+ it("defined", function () {
+ initializeDirective();
+ expect(directive).toBeDefined();
+ });
+
+ it("defined using GITHUB_MILESTONE", function () {
+ initializeDirective({attr: "type=\"GITHUB_MILESTONE\""});
+ expect(directive).toBeDefined();
+ });
+
+ it("defined using GITHUB_PROJECT", function () {
+ initializeDirective({attr: "type=\"GITHUB_PROJECT\""});
+ expect(directive).toBeDefined();
+ });
+
+ it("defined using VERSION_ONE", function () {
+ initializeDirective({attr: "type=\"VERSION_ONE\""});
+ expect(directive).toBeDefined();
+ });
+ });
+});
diff --git a/tests/unit/repo/remoteProjectManagerRepoTest.js b/tests/unit/repo/remoteProjectManagerRepoTest.js
index 17caba0..06d0cf2 100644
--- a/tests/unit/repo/remoteProjectManagerRepoTest.js
+++ b/tests/unit/repo/remoteProjectManagerRepoTest.js
@@ -36,8 +36,7 @@ describe("service: RemoteProjectManagerRepo", function () {
describe("Is the repo method", function () {
var methods = [
- "getTypes",
- "getTypeScaffolding"
+ "getTypes"
];
var repoMethodExists = function (key) {
@@ -59,13 +58,6 @@ describe("service: RemoteProjectManagerRepo", function () {
// TODO
});
-
- it("getTypeScaffolding work as expected", function () {
- var response = repo.getTypeScaffolding();
- $scope.$digest();
-
- // TODO
- });
});
});
|