Add missing tests and address AGENTS.md gaps

This commit is contained in:
Jack Kingsman
2026-02-23 20:26:57 -08:00
parent b9de3b7dd7
commit 5d7a313c53
9 changed files with 462 additions and 65 deletions
+16 -2
View File
@@ -64,8 +64,22 @@ test.describe('Channel messaging in #flightless', () => {
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 });
// Resend actions now live in the outgoing message status/path modal.
// Open it from either pending status (?) or echo-path indicator (✓...).
const statusOrPathTrigger = messageContainer.locator(
'[title="Message status"], [title="View echo paths"]'
);
await expect(statusOrPathTrigger.first()).toBeVisible({ timeout: 15_000 });
await statusOrPathTrigger.first().click();
const modal = page.getByRole('dialog');
await expect(modal).toBeVisible({ timeout: 10_000 });
// Byte-perfect resend option (within 30s) includes this helper text.
const resendButton = modal.getByRole('button', {
name: /Only repeated by new repeaters/i,
});
await expect(resendButton).toBeVisible({ timeout: 10_000 });
const resendResponsePromise = page.waitForResponse(
(response) =>
+40 -39
View File
@@ -2,53 +2,54 @@ import { test, expect } from '@playwright/test';
import { getRadioConfig, updateRadioConfig } from '../helpers/api';
test.describe('Radio settings', () => {
let originalName: string;
test.beforeAll(async () => {
const config = await getRadioConfig();
originalName = config.name;
});
test.afterAll(async () => {
// Restore original name via API
try {
await updateRadioConfig({ name: originalName });
} catch {
console.warn('Failed to restore radio name — manual intervention may be needed');
}
});
test('change radio name via settings UI and verify persistence', async ({ page }) => {
// Radio names are limited to 8 characters
const testName = 'E2Etest1';
const originalConfig = await getRadioConfig();
const originalName = originalConfig.name;
await page.goto('/');
await expect(page.getByText('Connected')).toBeVisible();
// Radio names are limited to 8 characters.
// Use a randomized name per run to avoid collisions with stale state.
const randomSuffix = Math.floor(Math.random() * 10000)
.toString()
.padStart(4, '0');
const testName = `E2E${randomSuffix}`; // 7 chars
// --- Step 1: Change the name via settings UI ---
await page.getByText('Settings').click();
await page.getByRole('button', { name: /Identity/i }).click();
try {
await page.goto('/');
await expect(page.getByText('Connected')).toBeVisible();
const nameInput = page.locator('#name');
await nameInput.clear();
await nameInput.fill(testName);
// --- Step 1: Change the name via settings UI ---
await page.getByText('Settings').click();
await page.getByRole('button', { name: /Identity/i }).click();
await page.getByRole('button', { name: 'Save Identity Settings' }).click();
await expect(page.getByText('Identity settings saved')).toBeVisible({ timeout: 10_000 });
const nameInput = page.locator('#name');
await nameInput.clear();
await nameInput.fill(testName);
// Exit settings page mode
await page.getByRole('button', { name: /Back to Chat/i }).click();
await page.getByRole('button', { name: 'Save Identity Settings' }).click();
await expect(page.getByText('Identity settings saved')).toBeVisible({ timeout: 10_000 });
// --- Step 2: Verify via API (now returns fresh data after send_appstart fix) ---
const config = await getRadioConfig();
expect(config.name).toBe(testName);
// Exit settings page mode
await page.getByRole('button', { name: /Back to Chat/i }).click();
// --- Step 3: Verify persistence across page reload ---
await page.reload();
await expect(page.getByText('Connected')).toBeVisible({ timeout: 15_000 });
// --- Step 2: Verify via API (now returns fresh data after send_appstart fix) ---
const config = await getRadioConfig();
expect(config.name).toBe(testName);
// --- Step 3: Verify persistence across page reload ---
await page.reload();
await expect(page.getByText('Connected')).toBeVisible({ timeout: 15_000 });
await page.getByText('Settings').click();
await page.getByRole('button', { name: /Identity/i }).click();
await expect(page.locator('#name')).toHaveValue(testName, { timeout: 10_000 });
} finally {
// Always restore original name, even when assertions fail.
try {
await updateRadioConfig({ name: originalName });
} catch {
console.warn('Failed to restore radio name — manual intervention may be needed');
}
}
await page.getByText('Settings').click();
await page.getByRole('button', { name: /Identity/i }).click();
await expect(page.locator('#name')).toHaveValue(testName, { timeout: 10_000 });
});
});