2016-12-08 07:21:37 +01:00
|
|
|
describe'/staff/get-all' do
|
|
|
|
request('/user/logout')
|
|
|
|
Scripts.login($staff[:email], $staff[:password], true)
|
|
|
|
|
|
|
|
it 'should get all staff member' do
|
|
|
|
result= request('/staff/get-all', {
|
|
|
|
csrf_userid: $csrf_userid,
|
|
|
|
csrf_token: $csrf_token
|
|
|
|
})
|
|
|
|
|
|
|
|
(result['status']).should.equal('success')
|
|
|
|
|
|
|
|
(result['data'][0]['name']).should.equal('Emilia Clarke')
|
|
|
|
(result['data'][0]['email']).should.equal('staff@opensupports.com')
|
2017-02-18 19:55:09 +01:00
|
|
|
(result['data'][0]['profilePic']).should.equal('')
|
2016-12-08 07:21:37 +01:00
|
|
|
(result['data'][0]['level']).should.equal('3')
|
2019-10-01 21:40:30 +02:00
|
|
|
(result['data'][0]['departments'][0]['id']).should.equal('2')
|
|
|
|
(result['data'][0]['departments'][0]['name']).should.equal('useless private deapartment')
|
|
|
|
(result['data'][0]['departments'][1]['id']).should.equal('1')
|
|
|
|
(result['data'][0]['departments'][1]['name']).should.equal('Help and Support')
|
2016-12-08 07:21:37 +01:00
|
|
|
(result['data'][0]['departments'][2]['id']).should.equal('3')
|
2018-11-23 23:44:10 +01:00
|
|
|
(result['data'][0]['departments'][2]['name']).should.equal('Suggestions')
|
2019-10-01 21:40:30 +02:00
|
|
|
(result['data'][0]['assignedTickets']).should.equal(10)
|
|
|
|
(result['data'][0]['closedTickets']).should.equal(1)
|
2016-12-08 07:21:37 +01:00
|
|
|
|
2017-06-25 11:07:14 +02:00
|
|
|
(result['data'][2]['name']).should.equal('Arya Stark')
|
2018-04-18 20:31:17 +02:00
|
|
|
(result['data'][2]['email']).should.equal('ayra2@opensupports.com')
|
2017-06-25 11:07:14 +02:00
|
|
|
(result['data'][2]['profilePic']).should.equal('')
|
|
|
|
(result['data'][2]['level']).should.equal('2')
|
|
|
|
(result['data'][2]['departments'][0]['id']).should.equal('1')
|
|
|
|
(result['data'][2]['departments'][0]['name']).should.equal('Help and Support')
|
2018-07-20 23:21:18 +02:00
|
|
|
(result['data'][2]['assignedTickets']).should.equal(1)
|
2017-06-25 11:07:14 +02:00
|
|
|
(result['data'][2]['closedTickets']).should.equal(0)
|
2016-12-08 07:21:37 +01:00
|
|
|
end
|
2018-04-18 20:31:17 +02:00
|
|
|
end
|