mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-01 16:44:16 +00:00
* feat: ws multi message * fix * fix * fix * improve: UX * improve: new message ui * fix * fix * fix * fix * fix * fix: rename message title * chore: cleanup * change: add message color * fix(websocket): correct cursor and truncate long message names --------- Co-authored-by: Sid <siddharth@usebruno.com>
37 lines
1.5 KiB
TypeScript
37 lines
1.5 KiB
TypeScript
import { expect, test } from '../../../playwright';
|
|
import { openRequest, closeAllCollections } from '../../utils/page/actions';
|
|
|
|
const COLLECTION_NAME = 'ws-multi-message';
|
|
const SINGLE_MSG_REQ = 'ws-single-msg';
|
|
|
|
test.describe('websocket message name styling', () => {
|
|
test.afterAll(async ({ pageWithUserData: page }) => {
|
|
await closeAllCollections(page);
|
|
});
|
|
|
|
test('editable message name uses the text (I-beam) cursor', async ({ pageWithUserData: page }) => {
|
|
await openRequest(page, COLLECTION_NAME, SINGLE_MSG_REQ);
|
|
|
|
await expect(page.getByTestId('ws-message-label-0')).toHaveCSS('cursor', 'text');
|
|
});
|
|
|
|
test('long message name truncates instead of overflowing', async ({ pageWithUserData: page }) => {
|
|
await openRequest(page, COLLECTION_NAME, SINGLE_MSG_REQ);
|
|
|
|
const longName = 'this is a very long websocket message name that should be truncated with an ellipsis';
|
|
|
|
// Rename the message to a name far wider than the row
|
|
await page.getByTestId('ws-message-label-0').dblclick();
|
|
const nameInput = page.getByTestId('ws-message-name-input-0');
|
|
await expect(nameInput).toBeVisible();
|
|
await nameInput.selectText();
|
|
await page.keyboard.type(longName);
|
|
await nameInput.press('Enter');
|
|
|
|
const messageLabel = page.getByTestId('ws-message-label-0').filter({ hasText: longName });
|
|
await expect(messageLabel).toBeVisible();
|
|
await expect(messageLabel).toHaveCSS('white-space', 'nowrap');
|
|
await expect(messageLabel).toHaveCSS('text-overflow', 'ellipsis');
|
|
});
|
|
});
|