Add resend button for 30s

This commit is contained in:
Jack Kingsman
2026-02-14 17:37:51 -08:00
parent 7b2d5b817e
commit 5a82d469b4
23 changed files with 570 additions and 171 deletions
-1
View File
@@ -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;
+36
View File
@@ -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);
});
});