mirror of
https://github.com/moparisthebest/mail
synced 2025-02-16 15:10:10 -05:00
fix unit tests
This commit is contained in:
parent
e13268625f
commit
50c48290d4
@ -36,7 +36,7 @@ define(function(require) {
|
||||
}, function(err, status) {
|
||||
expect(err).to.not.exist;
|
||||
expect(status).to.equal(InvitationDAO.INVITE_SUCCESS);
|
||||
expect(restDaoStub.put.calledWith(null, expectedUri)).to.be.true;
|
||||
expect(restDaoStub.put.calledWith({}, expectedUri)).to.be.true;
|
||||
done();
|
||||
});
|
||||
});
|
||||
@ -90,12 +90,12 @@ define(function(require) {
|
||||
invitationDao.invite({
|
||||
recipient: alice,
|
||||
}, expectError);
|
||||
|
||||
|
||||
invitationDao.invite({
|
||||
recipient: 123,
|
||||
sender: 123
|
||||
}, expectError);
|
||||
|
||||
|
||||
invitationDao.invite('asd', expectError);
|
||||
|
||||
function expectError(err, status) {
|
||||
@ -115,7 +115,10 @@ define(function(require) {
|
||||
}, function(err, status) {
|
||||
expect(err).to.not.exist;
|
||||
expect(status).to.equal(InvitationDAO.INVITE_PENDING);
|
||||
expect(restDaoStub.get.calledWith(null, expectedUri)).to.be.true;
|
||||
expect(restDaoStub.get.calledWith({
|
||||
uri: expectedUri,
|
||||
type: 'text'
|
||||
})).to.be.true;
|
||||
done();
|
||||
});
|
||||
});
|
||||
@ -172,12 +175,12 @@ define(function(require) {
|
||||
invitationDao.check({
|
||||
recipient: alice,
|
||||
}, expectError);
|
||||
|
||||
|
||||
invitationDao.check({
|
||||
recipient: 123,
|
||||
sender: 123
|
||||
}, expectError);
|
||||
|
||||
|
||||
invitationDao.check('asd', expectError);
|
||||
|
||||
function expectError(err, status) {
|
||||
|
@ -186,22 +186,6 @@ define(function(require) {
|
||||
scope.sendToOutbox();
|
||||
});
|
||||
|
||||
it('should not work if recipient does not have a public key', function(done) {
|
||||
scope.state.writer.open = true;
|
||||
scope.to = 'a, b, c';
|
||||
scope.body = 'asd';
|
||||
scope.subject = 'yaddablabla';
|
||||
|
||||
scope.onError = function(err) {
|
||||
expect(err).to.exist;
|
||||
expect(scope.state.writer.open).to.be.true;
|
||||
expect(deviceStorageMock.storeList.called).to.be.false;
|
||||
done();
|
||||
};
|
||||
|
||||
scope.sendToOutbox();
|
||||
});
|
||||
|
||||
it('should not work and not close the write view', function(done) {
|
||||
scope.state.writer.open = true;
|
||||
scope.to = 'a, b, c';
|
||||
|
Loading…
Reference in New Issue
Block a user