mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge pull request #868 from rogowski/bug-850
Test for bug-850 - Saving a deep object under a user node seems to lose public key at some depth. Add test.
This commit is contained in:
commit
06a4a0bfeb
@ -13,7 +13,7 @@
|
||||
"https": "HTTPS_KEY=test/https/server.key HTTPS_CERT=test/https/server.crt npm start",
|
||||
"prepublishOnly": "npm run unbuild",
|
||||
"test": "mocha",
|
||||
"testsea": "mocha test/sea.js",
|
||||
"testsea": "mocha test/sea/sea.js",
|
||||
"testaxe": "mocha test/axe/holy-grail.js",
|
||||
"e2e": "mocha e2e/distributed.js",
|
||||
"docker": "hooks/build",
|
||||
|
21
test/sea/sea.js
Normal file → Executable file
21
test/sea/sea.js
Normal file → Executable file
@ -430,8 +430,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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
}());
|
||||
|
Loading…
x
Reference in New Issue
Block a user