I believe I may have figured this out, but would appreciate any notes
if there is a better way to go about this. I set up a stub, like so:
var getLoginStatus = sinon.stub(
FB,
'getLoginStatus',
function(callback){
callback({status:'unknown'});
}
);
I am using qunit as my testing framework, so then I would go ahead and
call my wrapper and then my assertion, then for the next test I just
change getLoginStatus.
EG, in pseudo-code:
var getLoginStatus = sinon.stub(
FB,
'getLoginStatus',
function(callback){
callback({status:'unknown'});
}
);
mywrapper();
ok(expected result from status unknown):
getLoginStatus = sinon.stub(
FB,
'getLoginStatus',
function(callback){
callback({status:'connected'});
}
);
ok(expected result from status connected);
and so forth.