Skip to content

Commit

Permalink
test: rename user command
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrunton committed Jul 23, 2023
1 parent d4cff2a commit f85cbfc
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions e2e/tests/users.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { test as base, expect } from '@playwright/test';
import { Menu } from './fixtures/menu';
import { RoomPage } from './fixtures/room-page';
import { user2AuthFile } from './config';

const test = base.extend<{ menu: Menu, roomPage: RoomPage }>({
async menu({ page }, use) {
const menu = new Menu(page);
await use(menu);
},

async roomPage({ page }, use) {
const roomPage = new RoomPage(page);
await use(roomPage);
}
})

test('users can rename themselves', async ({ page, menu, roomPage }) => {
await page.goto('/');

await menu.open();
await menu.createRoom();

await roomPage.sendMessage('/rename user Joe Bloggs');
await expect(roomPage.getMessage('User Test User 1 renamed to Joe Bloggs')).toBeVisible();

await roomPage.sendMessage('/rename user Test User 1');
await expect(roomPage.getMessage('User Joe Bloggs renamed to Test User 1')).toBeVisible();
});

0 comments on commit f85cbfc

Please sign in to comment.