Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: make presence api tests fully independent #31782

Merged
merged 6 commits into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading