Wallet/test/test.storage.LocalPlain.js
Ryan X. Charles 69c5c3bc2e add setFromObj and getEncryptedObj to storage classes
This is so that you can export the file from the browser and use the same file
in the wallet file from the command-line. I have made encryption work
equivalently between the browser and node.
2014-04-17 18:04:56 -03:00

27 lines
762 B
JavaScript

'use strict';
if (typeof process === 'undefined' || !process.version) {
// browser
var chai = chai || require('chai');
var should = chai.should();
var copay = copay || require('../copay');
var LocalPlain = copay.StorageLocalPlain;
describe('Storage/LocalPlain model', function() {
it('should create an instance', function () {
var s = new LocalPlain();
should.exist(s);
});
describe('#setFromObj', function() {
it('should set keys from an object', function() {
localStorage.clear();
var obj = {test:'testval'};
var storage = new LocalPlain();
storage.setFromObj('walletId', obj);
storage.get('walletId', 'test').should.equal('testval');
});
});
});
}