copay/test/test.storage.LocalPlain.js

28 lines
762 B
JavaScript
Raw Normal View History

2014-04-14 13:17:56 -07:00
'use strict';
2014-04-14 14:08:18 -07:00
if (typeof process === 'undefined' || !process.version) {
// browser
2014-04-14 13:17:56 -07:00
var chai = chai || require('chai');
var should = chai.should();
var copay = copay || require('../copay');
2014-04-16 07:55:18 -07:00
var LocalPlain = copay.StorageLocalPlain;
2014-04-14 13:17:56 -07:00
2014-04-16 07:55:18 -07:00
describe('Storage/LocalPlain model', function() {
2014-04-14 13:17:56 -07:00
it('should create an instance', function () {
2014-04-16 07:55:18 -07:00
var s = new LocalPlain();
2014-04-14 13:17:56 -07:00
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');
});
});
2014-04-14 13:17:56 -07:00
});
}