mirror of
https://github.com/nasa/openmct.git
synced 2025-02-18 16:40:58 +00:00
[Core] Update failing specs
Update failing specs in core after changes for WTD-1033.
This commit is contained in:
parent
c55f9ff092
commit
5867f8ad98
@ -10,12 +10,15 @@ define(
|
||||
|
||||
describe("The mutation capability", function () {
|
||||
var testModel,
|
||||
mockNow,
|
||||
domainObject = { getModel: function () { return testModel; } },
|
||||
mutation;
|
||||
|
||||
beforeEach(function () {
|
||||
testModel = { number: 6 };
|
||||
mutation = new MutationCapability(domainObject);
|
||||
mockNow = jasmine.createSpy('now');
|
||||
mockNow.andReturn(12321);
|
||||
mutation = new MutationCapability(mockNow, domainObject);
|
||||
});
|
||||
|
||||
it("allows mutation of a model", function () {
|
||||
@ -41,6 +44,24 @@ define(
|
||||
// Number should not have been changed
|
||||
expect(testModel.number).toEqual(6);
|
||||
});
|
||||
|
||||
it("attaches a timestamp on mutation", function () {
|
||||
// Verify precondition
|
||||
expect(testModel.modified).toBeUndefined();
|
||||
mutation.invoke(function (m) {
|
||||
m.number = m.number * 7;
|
||||
});
|
||||
// Should have gotten a timestamp from 'now'
|
||||
expect(testModel.modified).toEqual(12321);
|
||||
});
|
||||
|
||||
it("allows a timestamp to be provided", function () {
|
||||
mutation.invoke(function (m) {
|
||||
m.number = m.number * 7;
|
||||
}, 42);
|
||||
// Should have gotten a timestamp from 'now'
|
||||
expect(testModel.modified).toEqual(42);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
@ -23,7 +23,8 @@ define(
|
||||
);
|
||||
mockDomainObject = {
|
||||
getId: function () { return id; },
|
||||
getModel: function () { return model; }
|
||||
getModel: function () { return model; },
|
||||
useCapability: jasmine.createSpy()
|
||||
};
|
||||
persistence = new PersistenceCapability(
|
||||
mockPersistenceService,
|
||||
|
Loading…
x
Reference in New Issue
Block a user