test sea - User\'s nodes must be signed when on user scope! issue #850 issue #616

This commit is contained in:
Adriano Rogowski 2019-12-27 23:05:42 -03:00
parent d9d9e5c5d0
commit c7dcbfbd7e

21
test/sea/sea.js Normal file → Executable file
View File

@ -360,8 +360,27 @@ describe('SEA', function(){
},9); },9);
}); });
}); });
});
it('User\'s nodes must be signed when on user scope!', function(done) {
/// https://github.com/amark/gun/issues/850
/// https://github.com/amark/gun/issues/616
this.timeout(9000);
var gun = Gun();
var user = gun.user();
user.auth('xavier', 'password');
gun.on('auth', function(){
user.get("testauthed").get("arumf").set({"this": "is", "an": {"obj2": "again2"}}, function(ack) {
var notsigned = [];
Gun.obj.map(gun._.graph, function(v,k) {
if (k[0]==='~' || k.indexOf('~', 1)!==-1) { return; } /// ignore '~pubkey' and '~@alias'
notsigned.push(k);
});
expect(notsigned.length).to.be(0); /// all souls must have to be suffixed with the user's pubkey.
done();
});
});
});
});
}) })
}()); }());