mirror of
https://github.com/nasa/openmct.git
synced 2025-03-24 04:55:21 +00:00
[Persistence] Update failing spec
...for instantiation capability, to reflect usage of identifier parser in determining which space an object should belong to.
This commit is contained in:
parent
689f80bb23
commit
44eb723efb
@ -28,19 +28,40 @@ define(
|
||||
|
||||
describe("The 'instantiation' capability", function () {
|
||||
var mockInjector,
|
||||
mockIdentifierService,
|
||||
mockInstantiate,
|
||||
mockIdentifier,
|
||||
mockDomainObject,
|
||||
instantiation;
|
||||
|
||||
beforeEach(function () {
|
||||
mockInjector = jasmine.createSpyObj("$injector", ["get"]);
|
||||
mockInstantiate = jasmine.createSpy("instantiate");
|
||||
mockIdentifierService = jasmine.createSpyObj(
|
||||
'identifierService',
|
||||
[ 'parse', 'generate' ]
|
||||
);
|
||||
mockIdentifier = jasmine.createSpyObj(
|
||||
'identifier',
|
||||
[ 'getSpace', 'getKey', 'getDefinedSpace' ]
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
[ 'getId', 'getCapability', 'getModel' ]
|
||||
);
|
||||
|
||||
mockInjector.get.andCallFake(function (key) {
|
||||
return key === 'instantiate' ?
|
||||
mockInstantiate : undefined;
|
||||
});
|
||||
mockIdentifierService.parse.andReturn(mockIdentifier);
|
||||
mockIdentifierService.generate.andReturn("some-id");
|
||||
|
||||
instantiation = new InstantiationCapability(mockInjector);
|
||||
instantiation = new InstantiationCapability(
|
||||
mockInjector,
|
||||
mockIdentifierService,
|
||||
mockDomainObject
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@ -59,7 +80,8 @@ define(
|
||||
mockInstantiate.andReturn(mockDomainObject);
|
||||
expect(instantiation.instantiate(testModel))
|
||||
.toBe(mockDomainObject);
|
||||
expect(mockInstantiate).toHaveBeenCalledWith(testModel);
|
||||
expect(mockInstantiate)
|
||||
.toHaveBeenCalledWith(testModel, jasmine.any(String));
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user