From c7dcbfbd7e633a3b2f11020f6e78a9e4550c6d81 Mon Sep 17 00:00:00 2001 From: Adriano Rogowski Date: Fri, 27 Dec 2019 23:05:42 -0300 Subject: [PATCH] test sea - User\'s nodes must be signed when on user scope! issue #850 issue #616 --- test/sea/sea.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) mode change 100644 => 100755 test/sea/sea.js diff --git a/test/sea/sea.js b/test/sea/sea.js old mode 100644 new mode 100755 index e4e5f70e..3ee71a1b --- a/test/sea/sea.js +++ b/test/sea/sea.js @@ -360,8 +360,27 @@ describe('SEA', function(){ },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(); + }); + }); + }); + }); }) -}()); \ No newline at end of file +}());