mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 15:02:23 +00:00
Updating tests
This commit is contained in:
parent
2f90a89065
commit
5cd458a733
@ -243,7 +243,7 @@ define(
|
|||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockQ = jasmine.createSpyObj('mockQ', ['when', 'all', 'reject']);
|
mockQ = jasmine.createSpyObj('mockQ', ['when', 'all', 'reject']);
|
||||||
//mockQ.when.andCallFake(synchronousPromise);
|
mockQ.when.andCallFake(synchronousPromise);
|
||||||
mockQ.all.andCallFake(function (promises) {
|
mockQ.all.andCallFake(function (promises) {
|
||||||
var result = {};
|
var result = {};
|
||||||
Object.keys(promises).forEach(function (k) {
|
Object.keys(promises).forEach(function (k) {
|
||||||
@ -272,7 +272,7 @@ define(
|
|||||||
|
|
||||||
compositionCapability
|
compositionCapability
|
||||||
.invoke
|
.invoke
|
||||||
.andReturn(compositionPromise);
|
.andReturn(synchronousPromise([childObject]));
|
||||||
|
|
||||||
object = domainObjectFactory({
|
object = domainObjectFactory({
|
||||||
name: 'object',
|
name: 'object',
|
||||||
@ -306,10 +306,10 @@ define(
|
|||||||
|
|
||||||
createObjectPromise = synchronousPromise(newObject);
|
createObjectPromise = synchronousPromise(newObject);
|
||||||
creationService.createObject.andReturn(createObjectPromise);
|
creationService.createObject.andReturn(createObjectPromise);
|
||||||
copyService = new CopyService(mockQ, creationService, policyService);
|
copyService = new CopyService(mockQ, creationService, policyService, mockPersistenceService);
|
||||||
console.log("Before perform");
|
console.log("Before perform");
|
||||||
compositionPromise.then.andReturn(synchronousPromise([childObject]));
|
//compositionPromise.then.andReturn(synchronousPromise([childObject]));
|
||||||
mockQ.when.andReturn(compositionPromise);
|
//mockQ.when.andReturn(compositionPromise);
|
||||||
copyResult = copyService.perform(object, newParent);
|
copyResult = copyService.perform(object, newParent);
|
||||||
console.log("After perform");
|
console.log("After perform");
|
||||||
//compositionPromise.then.mostRecentCall.args[0]([childObject]);
|
//compositionPromise.then.mostRecentCall.args[0]([childObject]);
|
||||||
@ -330,8 +330,9 @@ define(
|
|||||||
});*/
|
});*/
|
||||||
|
|
||||||
it("uses persistence service", function () {
|
it("uses persistence service", function () {
|
||||||
|
//Need a better way of testing duplication here.
|
||||||
expect(mockPersistenceService.createObject)
|
expect(mockPersistenceService.createObject)
|
||||||
.toHaveBeenCalledWith(persistenceCapability, jasmine.any(String), newParent);
|
.toHaveBeenCalledWith(persistenceCapability, jasmine.any(String), jasmine.any(Object));
|
||||||
|
|
||||||
expect(createObjectPromise.then)
|
expect(createObjectPromise.then)
|
||||||
.toHaveBeenCalledWith(jasmine.any(Function));
|
.toHaveBeenCalledWith(jasmine.any(Function));
|
||||||
|
Loading…
Reference in New Issue
Block a user