-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.js
54 lines (47 loc) · 1.14 KB
/
test.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
50
51
52
53
54
var toUser = {
"_id": "nicolsondsouza",
"inbox": [],
"outbox": [],
"follow": []
};
var fromUser = {
"_id": "eliasmoosman",
"inbox": [],
"outbox": [],
"follow": []
}
DummyData = {
"_id": "mTFJJYEMHscg62HdP",
"from": fromUser._id,
"to": toUser._id,
"picture_low": "http://i.imgur.com/DM4ZEp8.jpg"
}
if(Meteor.isServer){
Meteor.publish(null,function(){
return W.find({});
});
Meteor.publish(null,function(){
return WI.find({});
});
WI.remove({});
W.remove({});
WI.insert(fromUser);
WI.insert(toUser);
// Unionize.connect(DummyData);
var follow = {};
follow.profile_picture = "http://i.imgur.com/dZE9CXY.jpg";
follow._id = Random.id();
WI.update(toUser._id,{$push: {"follow": follow}});
}
if(Meteor.isClient){
Tinytest.add("Follow - Check if follow has DOM in data",function(test,next){
// Session.set("imageId",DummyData._id);
// setTimeout(function(){
var DomElement = React.renderComponentToString(Follow.FollowListReact(null))
// console.log(DomElement.match("DM4ZEp8")[0])
test.equal(DomElement.match("dZE9CXY")[0],"dZE9CXY", "didn't found image");
// if(next)
// next();
// },1000);
});
}