mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-08 17:53:10 +02:00
Add resend button for 30s
This commit is contained in:
@@ -174,7 +174,6 @@ export interface BotConfig {
|
||||
|
||||
export interface AppSettings {
|
||||
max_radio_contacts: number;
|
||||
experimental_channel_double_send: boolean;
|
||||
favorites: { type: string; id: string }[];
|
||||
auto_decrypt_dm_on_advert: boolean;
|
||||
sidebar_sort_order: string;
|
||||
|
||||
@@ -46,4 +46,40 @@ test.describe('Channel messaging in #flightless', () => {
|
||||
const messageContainer = messageEl.locator('..');
|
||||
await expect(messageContainer.getByText(/[?✓]/)).toBeVisible();
|
||||
});
|
||||
|
||||
test('resend outgoing channel message from message row', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
await page.getByText('#flightless', { exact: true }).first().click();
|
||||
await expect(page.getByPlaceholder(/message #flightless/i)).toBeVisible();
|
||||
|
||||
const testMessage = `resend-test-${Date.now()}`;
|
||||
const input = page.getByPlaceholder(/type a message|message #flightless/i);
|
||||
await input.fill(testMessage);
|
||||
await page.getByRole('button', { name: 'Send' }).click();
|
||||
|
||||
const messageEl = page.getByText(testMessage).first();
|
||||
await expect(messageEl).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
const messageContainer = messageEl.locator(
|
||||
'xpath=ancestor::div[contains(@class,"break-words")][1]'
|
||||
);
|
||||
const resendButton = messageContainer.getByTitle('Resend message');
|
||||
await expect(resendButton).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
const resendResponsePromise = page.waitForResponse(
|
||||
(response) =>
|
||||
response.request().method() === 'POST' &&
|
||||
/\/api\/messages\/channel\/\d+\/resend$/.test(response.url())
|
||||
);
|
||||
|
||||
await resendButton.click();
|
||||
|
||||
const resendResponse = await resendResponsePromise;
|
||||
expect(resendResponse.ok()).toBeTruthy();
|
||||
await expect(page.getByText('Message resent')).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
// Byte-perfect resend should not create a second visible row in this conversation.
|
||||
await expect(page.getByText(testMessage)).toHaveCount(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user