not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

32 lines
1018 B

define(["sugar-web/env", "sugar-web/datastore"], function (env, datastore) {
'use strict';
describe("Ensure the datastore object has an objectId", function () {
// FIXME does not work in standalone mode
it("should have objectId", function () {
var objectId = "objectId";
spyOn(env, "getObjectId").andCallFake(function (callback) {
setTimeout(function () {
callback(objectId);
}, 0);
});
var callback = jasmine.createSpy();
var datastoreObject = new datastore.DatastoreObject();
runs(function () {
datastoreObject.ensureObjectId(callback);
});
waitsFor(function () {
return datastoreObject.objectId !== undefined;
}, "should have objectId received from the environment");
runs(function () {
expect(callback).toHaveBeenCalled();
});
});
});
});