Skip to content

Commit

Permalink
test(getAllItems): get all items of a type successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianfranco97 authored and ajsb85 committed Oct 25, 2017
1 parent 09811d7 commit 964058a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const expect = require("chai").expect

const GlpiRestClient = require('../lib/restclient')
const config = require('../config.json')
const itemtype = require('../lib/itemtype')

// var client = new GlpiRestClient('http://localhost/~dethegeek/glpi-flyvemdm-92/apirest.php')

Expand Down Expand Up @@ -127,4 +128,19 @@ describe('getGlpiConfig()', function() {
})
})
})
})

describe('getAllItems()', function() {
this.timeout(15000)
it('get all items of a type successfully', () => {
const client = new GlpiRestClient(config.apirest)

return client.initSessionByUserToken(config.user.userToken)
.then(function() {
client.getAllItems(itemtype.User)
.then((result) => {
assert.deepInclude(result, { "status": 200 })
})
})
})
})

0 comments on commit 964058a

Please sign in to comment.