Skip to content

Commit

Permalink
regression: Fix teams.listAll end-to-end tests (#32586)
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 committed Jun 11, 2024
1 parent 903031c commit ea82dad
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apps/meteor/tests/end-to-end/api/25-teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,17 @@ describe('[Teams]', () => {
});

describe('/teams.listAll', () => {
let teamName;
before(async () => {
await updatePermission('view-all-teams', ['admin']);
const teamName = `test-team-${Date.now()}`;
teamName = `test-team-${Date.now()}`;
await request.post(api('teams.create')).set(credentials).send({
name: teamName,
type: 0,
});
});

after(async () => {
return updatePermission('view-all-teams', ['admin']);
});
after(() => Promise.all([deleteTeam(credentials, teamName), updatePermission('view-all-teams', ['admin'])]));

it('should list all teams', async () => {
await request
Expand All @@ -585,7 +584,7 @@ describe('[Teams]', () => {
expect(res.body).to.have.property('offset', 0);
expect(res.body).to.have.property('total');
expect(res.body).to.have.property('teams');
expect(res.body.teams).to.have.length.greaterThan(1);
expect(res.body.teams).to.be.an('array').that.is.not.empty;
expect(res.body.teams[0]).to.include.property('_id');
expect(res.body.teams[0]).to.include.property('_updatedAt');
expect(res.body.teams[0]).to.include.property('name');
Expand Down

0 comments on commit ea82dad

Please sign in to comment.