[Persistence] Add test cases
Adds test cases for TransactionalPersistenceCapability which brings coverage up to 100%.
This commit is contained in:
@@ -92,6 +92,18 @@ define(
|
|||||||
expect(mockPersistence.refresh).toHaveBeenCalled();
|
expect(mockPersistence.refresh).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("wraps getSpace", function () {
|
||||||
|
mockPersistence.getSpace.andReturn('foo');
|
||||||
|
expect(capability.getSpace()).toEqual('foo');
|
||||||
|
});
|
||||||
|
|
||||||
|
it("clears transactions and delegates refresh calls", function () {
|
||||||
|
capability.refresh();
|
||||||
|
expect(mockTransactionManager.clearTransactionsFor)
|
||||||
|
.toHaveBeenCalledWith(mockDomainObject);
|
||||||
|
expect(mockPersistence.refresh)
|
||||||
|
.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user