Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
533 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
var dataFeatureRequest1 = { | ||
id: 1, | ||
title: "Internal Request 1", | ||
description: "description 1", | ||
projectId: 1, | ||
productId: 1, | ||
rpmId: 1, | ||
scopeId: "scope 1" | ||
}; | ||
|
||
var dataFeatureRequest2 = { | ||
id: 2, | ||
title: "Internal Request 2", | ||
description: "description 2", | ||
projectId: 1, | ||
productId: 1, | ||
rpmId: 1, | ||
scopeId: "scope 2" | ||
}; | ||
|
||
var dataFeatureRequest3 = { | ||
id: 3, | ||
title: "Internal Request 3", | ||
description: "description 3", | ||
projectId: 2, | ||
productId: 2, | ||
rpmId: 2, | ||
scopeId: "scope 3" | ||
}; | ||
|
||
// There is no actual FeatureRequest model and only exists as data objects. | ||
var mockFeatureRequest = function ($q) { | ||
var model = mockModel("FeatureRequest", $q, dataFeatureRequest1); | ||
|
||
return model; | ||
}; | ||
|
||
angular.module("mock.featureRequest", []).service("FeatureRequest", mockFeatureRequest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var mockProductsService = function ($q, ProductRepo, WsApi) { | ||
var service = mockService($q); | ||
|
||
var products = {}; | ||
|
||
service.getById = function (id) { | ||
// @todo | ||
return {}; | ||
} | ||
|
||
service.getProductRemoteProducts = function (id) { | ||
// @todo | ||
return {}; | ||
}; | ||
|
||
service.getProducts = function () { | ||
return products; | ||
}; | ||
|
||
service.refreshProducts = function () { | ||
// @todo | ||
}; | ||
|
||
return service; | ||
}; | ||
|
||
angular.module("mock.productsService", []).service("ProductsService", mockProductsService); |
36 changes: 36 additions & 0 deletions
36
tests/mock/service/mockRemoteProductsByProductIdService.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var mockRemoteProductsByProductIdService = function ($q, WsApi) { | ||
var service = mockService($q); | ||
|
||
var productId; | ||
var remoteProducts = {}; | ||
|
||
service.refreshRemoteProductsByProductId = function (id) { | ||
if (productId == id) { | ||
return; | ||
} | ||
|
||
if (remoteProducts) { | ||
for (var key in remoteProducts) { | ||
remoteProducts[key] = undefined; | ||
} | ||
} | ||
|
||
if (!id) { | ||
return; | ||
} | ||
|
||
productId = id; | ||
}; | ||
|
||
service.productId = function () { | ||
return productId; | ||
}; | ||
|
||
service.remoteProducts = function () { | ||
return remoteProducts; | ||
}; | ||
|
||
return service; | ||
}; | ||
|
||
angular.module("mock.remoteProductsByProductIdService", []).service("RemoteProductsByProductIdService", mockRemoteProductsByProductIdService); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.