mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
27 lines
951 B
TypeScript
27 lines
951 B
TypeScript
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
|
|
import {createTestAccount} from '../../auth/tests/AuthTestUtils';
|
|
import {type ApiTestHarness, createApiTestHarness} from '../../test/ApiTestHarness';
|
|
import {createDmChannel} from './ChannelTestUtils';
|
|
|
|
describe('DM creation allowed with strangers', () => {
|
|
let harness: ApiTestHarness;
|
|
beforeAll(async () => {
|
|
harness = await createApiTestHarness();
|
|
});
|
|
beforeEach(async () => {
|
|
await harness.reset();
|
|
});
|
|
afterAll(async () => {
|
|
await harness?.shutdown();
|
|
});
|
|
it('allows opening a DM with a stranger who shares no guild and is not a friend', async () => {
|
|
const user1 = await createTestAccount(harness);
|
|
const user2 = await createTestAccount(harness);
|
|
const dm = await createDmChannel(harness, user1.token, user2.userId);
|
|
expect(dm.id).toBeTruthy();
|
|
expect(dm.id.length).toBeGreaterThan(0);
|
|
});
|
|
});
|