snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-16 01:21:02 +05:00
commit 30810eecd7
10161 changed files with 987110 additions and 0 deletions

View File

@@ -0,0 +1,137 @@
import { Users } from './fixtures/userStates';
import { HomeChannel } from './page-objects';
import { createDirectMessage, createTargetChannel, deleteChannel } from './utils';
import { test, expect } from './utils/test';
const embeddedLayoutURL = (pageUrl: string) => `${pageUrl}?layout=embedded`;
test.use({ storageState: Users.user1.state });
test.describe('embedded-layout', () => {
let poHomeChannel: HomeChannel;
let targetChannelId: string;
let notMemberChannelId: string;
let joinChannelId: string;
test.beforeAll(async ({ api }) => {
[targetChannelId, notMemberChannelId, joinChannelId] = await Promise.all([
createTargetChannel(api, { members: ['user1'] }),
createTargetChannel(api, { members: ['user2'] }),
createTargetChannel(api, { members: ['user2'] }),
]);
});
test.afterAll(async ({ api }) => {
await Promise.all([deleteChannel(api, targetChannelId), deleteChannel(api, notMemberChannelId), deleteChannel(api, joinChannelId)]);
});
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);
});
test.describe('Layout elements visibility', () => {
test('should hide primary navigation elements in embedded layout', async ({ page }) => {
await poHomeChannel.gotoChannel(targetChannelId);
await expect(poHomeChannel.roomHeaderToolbar).toBeVisible();
await page.goto(embeddedLayoutURL(page.url()));
await expect(poHomeChannel.roomHeaderToolbar).not.toBeVisible();
await poHomeChannel.sidebar.waitForDismissal();
});
test.describe('should show room header toolbar when show top navbar setting is enabled', () => {
test.beforeAll(async ({ api }) => {
await api.post('/settings/UI_Show_top_navbar_embedded_layout', { value: true });
});
test.afterAll(async ({ api }) => {
await api.post('/settings/UI_Show_top_navbar_embedded_layout', { value: false });
});
test('should show room header toolbar as top navbar when setting enabled', async ({ page }) => {
await poHomeChannel.gotoChannel(targetChannelId);
await page.goto(embeddedLayoutURL(page.url()));
await expect(poHomeChannel.roomHeaderToolbar).toBeVisible();
});
});
});
test.describe('Channel member functionality', () => {
test('should hide join button and enable messaging for members', async ({ page }) => {
await poHomeChannel.gotoChannel(targetChannelId);
await page.goto(embeddedLayoutURL(page.url()));
await expect(poHomeChannel.composer.inputMessage).toBeVisible();
await expect(poHomeChannel.composer.inputMessage).toBeEnabled();
await expect(poHomeChannel.composer.btnJoinRoom).not.toBeVisible();
});
test('should allow sending and receiving messages', async ({ page }) => {
await poHomeChannel.gotoChannel(targetChannelId);
await page.goto(embeddedLayoutURL(page.url()));
const testMessage = `Embedded test message ${Date.now()}`;
await poHomeChannel.content.sendMessage(testMessage);
await expect(poHomeChannel.content.lastUserMessage).toContainText(testMessage);
});
test('should preserve message composer functionality', async ({ page }) => {
await poHomeChannel.gotoChannel(targetChannelId);
await page.goto(embeddedLayoutURL(page.url()));
await expect(poHomeChannel.composer.inputMessage).toBeVisible();
await expect(poHomeChannel.composer.toolbarPrimaryActions).toBeVisible();
await poHomeChannel.composer.inputMessage.fill('Test message');
await expect(poHomeChannel.composer.inputMessage).toHaveValue('Test message');
await poHomeChannel.composer.inputMessage.fill('');
await expect(poHomeChannel.composer.inputMessage).toHaveValue('');
});
});
test.describe('Channel non-member functionality', () => {
test('should display join button and disable composer for non-members', async ({ page }) => {
await poHomeChannel.goto();
await poHomeChannel.navbar.openChat(notMemberChannelId);
await page.goto(embeddedLayoutURL(page.url()));
await expect(poHomeChannel.composer.inputMessage).toBeDisabled();
await expect(poHomeChannel.composer.btnJoinRoom).toBeVisible();
});
test('should allow joining channel and enable messaging', async ({ page }) => {
await poHomeChannel.goto();
await poHomeChannel.navbar.openChat(joinChannelId);
await page.goto(embeddedLayoutURL(page.url()));
await poHomeChannel.composer.btnJoinRoom.click();
await expect(poHomeChannel.composer.btnJoinRoom).not.toBeVisible();
await expect(poHomeChannel.composer.inputMessage).toBeVisible();
await expect(poHomeChannel.composer.inputMessage).toBeEnabled();
const joinMessage = `Joined and sent message ${Date.now()}`;
await poHomeChannel.content.sendMessage(joinMessage);
await expect(poHomeChannel.content.lastUserMessage).toContainText(joinMessage);
});
});
test.describe('Direct message functionality', () => {
test('should allow sending direct messages', async ({ page, api }) => {
await createDirectMessage(api);
await poHomeChannel.goto();
await poHomeChannel.navbar.openChat(Users.user2.data.username);
await page.goto(embeddedLayoutURL(page.url()));
await expect(poHomeChannel.composer.inputMessage).toBeVisible();
await expect(poHomeChannel.composer.inputMessage).toBeEnabled();
await expect(poHomeChannel.composer.btnJoinRoom).not.toBeVisible();
const dmMessage = `Embedded DM test ${Date.now()}`;
await poHomeChannel.content.sendMessage(dmMessage);
await expect(poHomeChannel.content.lastUserMessage).toContainText(dmMessage);
});
});
});