The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/e2e/sidebar-menu.spec.ts

35 lines
1.4 KiB

import { Users } from './fixtures/userStates';
import { test, expect } from './utils/test';
test.use({ storageState: Users.admin.state });
test.describe('sidebar-menu', () => {
test('expect popover to stay open after home loads', async ({ page }) => {
await page.route('**/__meteor__/dynamic-import/fetch', async (route, request) => {
if (request.postData()?.includes('HomePage.tsx')) {
await new Promise((resolve) => setTimeout(resolve, 1000)); // Simulate network delay
}
await route.continue();
});
await page.goto('/home', { waitUntil: 'domcontentloaded' });
await expect(page.getByRole('button', { name: 'Create new' })).toBeVisible();
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('ArrowRight');
await page.keyboard.press('ArrowRight');
await page.keyboard.press('Enter');
await page.waitForURL('/directory/channels');
const textContent = await page.evaluate(() => document.activeElement?.textContent);
expect(textContent).toMatch(/Directory/);
await page.getByRole('button', { name: 'Create new' }).click();
await expect(page.getByRole('menu', { name: 'Create new' })).toBeVisible();
await page.getByRole('menuitem', { name: 'Direct message' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Cancel' }).click();
});
});