Skip to content

Commit

Permalink
Add API test
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Jul 15, 2022
1 parent 80427ff commit 11c4e15
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apps/meteor/tests/end-to-end/api/02-channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,7 @@ describe('[Channels]', function () {
})
.end(done);
});

describe('/channels.members', () => {
it('should return an array of members by channel', (done) => {
request
Expand All @@ -1062,6 +1063,7 @@ describe('[Channels]', function () {
})
.end(done);
});

it('should return an array of members by channel even requested with count and offset params', (done) => {
request
.get(api('channels.members'))
Expand All @@ -1082,6 +1084,27 @@ describe('[Channels]', function () {
})
.end(done);
});

it('should return an filtered array of members by channel', (done) => {
request
.get(api('channels.members'))
.set(credentials)
.query({
roomId: channel._id,
filter: 'rocket.cat',
})
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('success', true);
expect(res.body).to.have.property('members').and.to.be.an('array');
expect(res.body).to.have.property('count');
expect(res.body).to.have.property('count', 1);
expect(res.body).to.have.property('total');
expect(res.body).to.have.property('offset');
})
.end(done);
});
});

it('/channels.rename', async () => {
Expand Down

0 comments on commit 11c4e15

Please sign in to comment.