Skip to content

Commit

Permalink
Add tests for improved coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
arran-standish committed Jun 12, 2023
1 parent ff50d4b commit 7c2bfbd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/unit/contactTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,25 @@ describe('Contact Users', () => {
)
})
})

describe('contactUser', () => {
it('should throw if passed the incorrect method type', done => {
contact.contactUser('none', '', '', '', '', (err) => {
should.exist(err)
should.equal(err.message, "Unknown contact method 'none'")
return done()
})
})

it('should throw on sms send if sms provider is not listed', done => {
config.smsGateway.provider = 'none'
contact.contactUser('sms', 'test', '', 'test message', '', (err) => {
should.exist(err)
should.equal(err.message, "Unknown SMS gateway provider 'none'")

config.smsGateway.provider = 'clickatell'
return done()
})
})
})
})

0 comments on commit 7c2bfbd

Please sign in to comment.