|
|
|
|
@ -188,8 +188,18 @@ describe('[Direct Messages]', function () { |
|
|
|
|
.expect(200) |
|
|
|
|
.expect((res) => { |
|
|
|
|
expect(res.body).to.have.property('success', true); |
|
|
|
|
expect(res.body).to.have.property('count'); |
|
|
|
|
expect(res.body).to.have.property('total'); |
|
|
|
|
expect(res.body).to.have.property('count', 1); |
|
|
|
|
expect(res.body).to.have.property('total', 1); |
|
|
|
|
expect(res.body).to.have.property('ims').and.to.be.an('array'); |
|
|
|
|
const im = res.body.ims[0]; |
|
|
|
|
expect(im).to.have.property('_id'); |
|
|
|
|
expect(im).to.have.property('t').and.to.be.eq('d'); |
|
|
|
|
expect(im).to.have.property('msgs').and.to.be.a('number'); |
|
|
|
|
expect(im).to.have.property('usernames').and.to.be.an('array'); |
|
|
|
|
expect(im).to.have.property('lm'); |
|
|
|
|
expect(im).to.have.property('_updatedAt'); |
|
|
|
|
expect(im).to.have.property('ts'); |
|
|
|
|
expect(im).to.have.property('lastMessage'); |
|
|
|
|
}) |
|
|
|
|
.end(done); |
|
|
|
|
}); |
|
|
|
|
@ -202,8 +212,19 @@ describe('[Direct Messages]', function () { |
|
|
|
|
.expect(200) |
|
|
|
|
.expect((res) => { |
|
|
|
|
expect(res.body).to.have.property('success', true); |
|
|
|
|
expect(res.body).to.have.property('count'); |
|
|
|
|
expect(res.body).to.have.property('total'); |
|
|
|
|
expect(res.body).to.have.property('count', 1); |
|
|
|
|
expect(res.body).to.have.property('total', 1); |
|
|
|
|
expect(res.body).to.have.property('ims').and.to.be.an('array'); |
|
|
|
|
const im = res.body.ims[0]; |
|
|
|
|
expect(im).to.have.property('_id'); |
|
|
|
|
expect(im).to.have.property('t').and.to.be.eq('d'); |
|
|
|
|
expect(im).to.have.property('msgs').and.to.be.a('number'); |
|
|
|
|
expect(im).to.have.property('usernames').and.to.be.an('array'); |
|
|
|
|
expect(im).to.have.property('ro'); |
|
|
|
|
expect(im).to.have.property('sysMes'); |
|
|
|
|
expect(im).to.have.property('_updatedAt'); |
|
|
|
|
expect(im).to.have.property('ts'); |
|
|
|
|
expect(im).to.have.property('lastMessage'); |
|
|
|
|
}) |
|
|
|
|
.end(done); |
|
|
|
|
}); |
|
|
|
|
|