test: move ParticipantNameService tests to integration tests

This commit is contained in:
juancarmore 2025-09-24 12:37:34 +02:00
parent 398a605d2c
commit 1e0f62c7bd
3 changed files with 8 additions and 10 deletions

View File

@ -1,8 +1,8 @@
import { describe, expect, it, beforeEach, afterEach, beforeAll } from '@jest/globals';
import { container, registerDependencies } from '../../../src/config/index.js';
import { ParticipantNameService } from '../../../src/services/participant-name.service.js';
import { RedisService } from '../../../src/services/redis.service.js';
import { afterEach, beforeAll, describe, expect, it } from '@jest/globals';
import ms from 'ms';
import { container, registerDependencies } from '../../../../src/config/index.js';
import { ParticipantNameService } from '../../../../src/services/participant-name.service.js';
import { RedisService } from '../../../../src/services/redis.service.js';
describe('ParticipantNameService', () => {
let participantNameService: ParticipantNameService;
@ -13,10 +13,7 @@ describe('ParticipantNameService', () => {
registerDependencies();
participantNameService = container.get(ParticipantNameService);
redisService = container.get(RedisService);
});
beforeEach(async () => {
// Clean up any existing test data
await cleanupTestData();
});

View File

@ -276,7 +276,6 @@ test.describe('Room Functionality Tests', () => {
fs.unlinkSync('after.png');
fs.unlinkSync('diff.png');
await page.waitForTimeout(3000);
await leaveRoom(page);
});
});

View File

@ -256,11 +256,13 @@ export const viewRecordingsAs = async (role: 'moderator' | 'speaker', page: Page
};
export const leaveRoom = async (page: Page, role: 'moderator' | 'speaker' = 'speaker') => {
await interactWithElementInIframe(page, '#leave-btn', { action: 'click' });
const button = await waitForElementInIframe(page, '#leave-btn');
await button.click();
if (role === 'moderator') {
await page.waitForTimeout(500); // Wait for leave animation
await interactWithElementInIframe(page, '#leave-option', { action: 'click' });
const option = await waitForElementInIframe(page, '#leave-option');
await option.click();
}
await page.waitForSelector('.event-left');