copay/test/test.wallet.js

48 lines
1.0 KiB
JavaScript
Raw Normal View History

2014-04-10 13:57:41 -07:00
'use strict';
2014-04-14 14:30:08 -07:00
var chai = chai || require('chai');
var should = chai.should();
var copay = copay || require('../copay');
var Wallet = require('soop').load('../js/models/core/Wallet', {
Storage: require('./FakeStorage'),
Network: copay.WebRTC,
Blockchain: copay.Insight
});
2014-04-10 13:57:41 -07:00
2014-04-14 14:30:08 -07:00
console.log(Wallet);
2014-04-10 13:57:41 -07:00
describe('Wallet model', function() {
2014-04-14 14:30:08 -07:00
var config = {
wallet: {
requiredCopayers: 3,
totalCopayers: 5,
}
};
var opts = {};
2014-04-10 13:57:41 -07:00
2014-04-14 14:30:08 -07:00
it.skip('should create an instance', function () {
2014-04-14 13:17:56 -07:00
var opts = {};
2014-04-14 14:30:08 -07:00
var w = Wallet.create(config, opts);
2014-04-10 13:57:41 -07:00
should.exist(w);
});
2014-04-14 14:30:08 -07:00
describe('factory', function() {
it('should create the factory', function() {
should.exist(Wallet.factory);
});
it('should be able to create wallets', function() {
var w = Wallet.factory.create(config, opts);
should.exist(w);
});
it.skip('should be able to get wallets', function() {
var w = Wallet.factory.create(config, opts);
var v = Wallet.factory.get(config, w.id);
should.exist(w);
});
});
2014-04-10 13:57:41 -07:00
});