Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Removed unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleitner committed Jul 20, 2016
1 parent 6113a69 commit 8cd6ba8
Showing 1 changed file with 0 additions and 78 deletions.
78 changes: 0 additions & 78 deletions app/test/unit/userdata.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,84 +210,6 @@ describe('UserData', function() {

});

describe('#getBalance', function() {

it('should return error if invalid address', function(done) {
var userdata = new UserData(os.tmpdir());
userdata.getBalance('', function(err) {
expect(err.message).to.equal('Invalid payout address');
done();
});
});

it('should bubble up request error', function(done) {
var UserData = proxyquire('../../lib/userdata', {
request: function(options, callback) {
callback(new Error('Unknown error'));
}
});
var userdata = new UserData(os.tmpdir());
userdata.getBalance(
'3HwoE3LBpQkRsghHLT7MCwFw9nRSYQwZhY',
function(err) {
expect(err.message).to.equal('Unknown error');
done();
}
);
});

it('should return error if the body indicates one', function(done) {
var UserData = proxyquire('../../lib/userdata', {
request: function(options, callback) {
callback(null, {}, { status: 'error', message: 'FAILED' });
}
});
var userdata = new UserData(os.tmpdir());
userdata.getBalance(
'3HwoE3LBpQkRsghHLT7MCwFw9nRSYQwZhY',
function(err) {
expect(err.message).to.equal('FAILED');
done();
}
);
});

it('should return balance in the body', function(done) {
var UserData = proxyquire('../../lib/userdata', {
request: function(options, callback) {
callback(null, {}, { data: [{ balance: 100 }] });
}
});
var userdata = new UserData(os.tmpdir());
userdata.getBalance(
'3HwoE3LBpQkRsghHLT7MCwFw9nRSYQwZhY',
function(err, balance) {
expect(err).to.equal(null);
expect(balance).to.equal(100);
done();
}
);
});

it('should return 0 if no error and no balance', function(done) {
var UserData = proxyquire('../../lib/userdata', {
request: function(options, callback) {
callback(null, {}, { data: [] });
}
});
var userdata = new UserData(os.tmpdir());
userdata.getBalance(
'3HwoE3LBpQkRsghHLT7MCwFw9nRSYQwZhY',
function(err, balance) {
expect(err).to.equal(null);
expect(balance).to.equal(0);
done();
}
);
});

});

describe('#saveConfig', function() {

it('should write the tab objects to disk', function(done) {
Expand Down

0 comments on commit 8cd6ba8

Please sign in to comment.