Add unit test for custom localstorage item name

This commit is contained in:
Thomas Oberndörfer 2014-02-06 12:20:52 +01:00
parent 69bf01fb86
commit d46ef40390

View File

@ -87,5 +87,15 @@ describe("Keyring", function() {
expect(keys).to.exist.and.have.length(1);
done();
});
it('customize localstorage itemname', function() {
var localstore1 = new openpgp.Keyring.localstore('my-custom-name');
var localstore2 = new openpgp.Keyring.localstore('my-custom-name');
var localstore3 = new openpgp.Keyring.localstore();
localstore3.store([]);
var key = openpgp.key.readArmored(pubkey).keys[0];
localstore1.store([key]);
expect(localstore2.load()[0].primaryKey.getKeyId().equals(key.primaryKey.getKeyId())).to.be.true;
expect(localstore3.load()).to.have.length(0);
});
});