forked from artwells/meteor-accounts-guest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
accounts-guest-client-tests.js
49 lines (43 loc) · 1.13 KB
/
accounts-guest-client-tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Tinytest.add(
'guest - account creation',
function (test) {
res = Meteor.call("createGuest");
uid = Meteor.userId();
test.isTrue((typeof uid !== undefined && typeof uid !== null), 'no userId returned');
}
);
/*
Tinytest.addAsync(
'guest - guest after logout',
function (test,next) {
Meteor.loginWithPassword(AccountsGuest.testname, AccountsGuest.testpass, function(err){
if(err){
console.log('Error logging in '+err);
return false;
}
});
userid = Meteor.userId();
test.isTrue(typeof userid !== undefined, 'no userId returned');
test.isTrue(userid != 'null', 'no userId returned');
Meteor.logout(function(err){
if(err){
console.log('Error logging out '+err);
return false;
}
seconduid = Meteor.userId();
test.isNotNull(seconduid, 'uid null');
test.notEqual(userid, seconduid, 'new uid issued');
console.log(seconduid + uid +'uuuu');
});
next();
});
*/
Tinytest.add(
'guest - test disable',
function (test) {
AccountsGuest.enabled = false;
res = Meteor.call("createGuest");
uid = Meteor.userId();
test.isTrue((typeof uid !== undefined && typeof uid !== null), 'working');
}
);