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