Files
Sable/tests/e2e/shell.spec.ts
T

33 lines
1.1 KiB
TypeScript

import type { Page } from '@playwright/test';
import { test, expect } from './fixtures/test';
const containerised = Boolean(process.env.PW_TEST_CONNECT_WS_ENDPOINT);
const maskDynamic = (page: Page) => ({
mask: [page.locator('time'), page.getByText(/^Created by /)],
});
test.describe('app shell', () => {
test('shows seeded rooms after login', async ({ app }) => {
await expect(app.room('General')).toBeVisible();
await expect(app.room('Random')).toBeVisible();
});
test('opens a room and renders its timeline', async ({ app, page }) => {
await app.room('General').click();
await expect(page.getByText('Welcome to the test room.')).toBeVisible();
await expect(page.getByText('Layout baseline seed message.')).toBeVisible();
});
test('matches the shell layout baseline', async ({ app, page }) => {
test.skip(!containerised, 'run via pnpm test:e2e:docker');
await expect(app.room('General')).toBeVisible();
await page.evaluate(async () => {
await document.fonts.ready;
});
await expect(page).toHaveScreenshot('shell.png', maskDynamic(page));
});
});