MXS-1300: Improve test coverage

The tests now cover 100% of all source files with the exception of the
call.js and common.js source files.
This commit is contained in:
Markus Mäkelä
2017-07-22 02:53:39 +03:00
parent 090de1a0f7
commit c9f3d014d6
11 changed files with 109 additions and 27 deletions

View File

@ -1,20 +1,41 @@
require('../test_utils.js')()
var ctrl = require('../lib/core.js')
var opts = { extra_args: [ '--quiet'] }
describe("Enable/Disable Commands", function() {
before(startMaxScale)
it('disable with bad parameter', function() {
return doCommand('disable log-priority bad-stuff')
.should.be.rejected
it('enable log-priority', function() {
return verifyCommand('enable log-priority info', 'maxscale/logs')
.then(function(res) {
res.data.attributes.log_priorities.should.include('info')
})
})
it('enable with bad parameter', function() {
it('disable log-priority', function() {
return verifyCommand('disable log-priority info', 'maxscale/logs')
.then(function(res) {
res.data.attributes.log_priorities.should.not.include('info')
})
})
it('enable log-priority with bad parameter', function() {
return doCommand('enable log-priority bad-stuff')
.should.be.rejected
})
it('disable log-priority with bad parameter', function() {
return doCommand('disable log-priority bad-stuff')
.should.be.rejected
})
it('enable account', function() {
return verifyCommand('enable account test', 'users/unix/test')
.should.be.fulfilled
})
it('disable account', function() {
return doCommand('disable account test')
.should.be.fulfilled
})
after(stopMaxScale)
});