Skip to content

Commit

Permalink
test: make presence api tests fully independent (#31782)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored Mar 28, 2024
1 parent 466de64 commit 3158edf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions apps/meteor/tests/end-to-end/api/27-presence.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import { expect } from 'chai';
import { before, describe, it } from 'mocha';
import { before, describe, it, after } from 'mocha';
import type { Response } from 'supertest';

import { getCredentials, api, request, credentials } from '../../data/api-data.js';
import { updatePermission } from '../../data/permissions.helper';
import { password } from '../../data/user';
import { createUser, login } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Presence]', function () {
let createdUser: any;
this.retries(0);

before((done) => getCredentials(done));

let unauthorizedUserCredentials: any;
before(async () => {
const createdUser = await createUser();
createdUser = await createUser();
unauthorizedUserCredentials = await login(createdUser.username, password);
});

after(() => Promise.all([updatePermission('manage-user-status', ['admin']), deleteUser(createdUser)]));

describe('[/presence.getConnections]', () => {
it('should throw an error if not authenticated', async () => {
await request
Expand Down

0 comments on commit 3158edf

Please sign in to comment.