Add controller tests (#4205)
* add walletHome test template * add create test * add fixtures * do not mock parseSecret * better hash * use fixtures for create controller test * add import test * stubs reset * add more controller tests * Remove $state dependency * refactore fixtures + profiles * add backup.js test * update bwc * rm log
This commit is contained in:
parent
335c3f00af
commit
aec2aac47b
20 changed files with 2265 additions and 28 deletions
46
test/controllers/backup.test.js
Normal file
46
test/controllers/backup.test.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
describe('Backup Controller', function() {
|
||||
|
||||
var walletService;
|
||||
|
||||
describe('Incomplete wallet', function() {
|
||||
beforeEach(function(done) {
|
||||
mocks.init(FIXTURES, 'backupController', {
|
||||
loadProfile: PROFILE.incomplete2of2,
|
||||
}, done);
|
||||
});
|
||||
|
||||
afterEach(function(done) {
|
||||
mocks.clear({}, done);
|
||||
});
|
||||
|
||||
it('should be defined', function() {
|
||||
should.exist(ctrl);
|
||||
});
|
||||
it('should set the mnemonic incomplete wallets', function(done) {
|
||||
should.exist(ctrl);
|
||||
ctrl.mnemonicWords.should.deep.equal('dizzy cycle skirt decrease exotic fork sure mixture hair vapor copper hero'.split(' '));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Complete 1-1 wallet', function() {
|
||||
beforeEach(function(done) {
|
||||
mocks.init(FIXTURES, 'backupController', {
|
||||
loadProfile: PROFILE.testnet1of1,
|
||||
}, done);
|
||||
});
|
||||
|
||||
afterEach(function(done) {
|
||||
mocks.clear({}, done);
|
||||
});
|
||||
|
||||
it('should not set the mnemonic for complete wallets', function() {
|
||||
ctrl.mnemonicWords.should.deep.equal('cheese where alarm job conduct donkey license pave congress pepper fence current'.split(' '));
|
||||
});
|
||||
|
||||
it('should set main wallet info', function(done) {
|
||||
ctrl.walletName.should.equal('kk');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue