Point the TrueNAS mention spec at the live surface and mark it fixme

The spec entered through a retired settings route with an inert REST
stub (mention candidates come from websocket state) and the old Expand
Pulse Assistant launcher name. Re-pointed at the TrueNAS platform page
and the Ask Pulse Assistant launcher, it exposes a real regression:
Docker app-containers appear in the @-mention autocomplete but TrueNAS
app-containers no longer do, despite identical resource typing in
websocket state. The spec keeps the contract and skips via fixme until
mention targeting is restored.
This commit is contained in:
rcourtman 2026-07-08 17:16:25 +01:00
parent 95a7c7f3f5
commit 476e0bccb8

View file

@ -39,6 +39,11 @@ test.describe('TrueNAS AI chat mentions', () => {
test.setTimeout(180_000);
test('surfaces TrueNAS apps as canonical assistant mention targets', async ({ page }) => {
// Real product regression, not spec rot: Docker app-containers appear in
// the @-mention autocomplete but TrueNAS app-containers no longer do,
// despite living in websocket state with the same resource type.
// Re-enable once TrueNAS apps regain mention targeting (tracked).
test.fixme(true, 'TrueNAS apps missing from assistant mention targets (tracked)');
await page.route('**/api/truenas/connections', async (route) => {
if (route.request().method() !== 'GET') {
await route.continue();
@ -158,33 +163,23 @@ test.describe('TrueNAS AI chat mentions', () => {
});
});
await page.goto('/settings/infrastructure/platforms/truenas', {
waitUntil: 'domcontentloaded',
});
await page.waitForURL(/\/settings\/infrastructure\/platforms\/truenas/, {
timeout: 15_000,
});
await page.goto('/truenas', { waitUntil: 'domcontentloaded' });
const resourcesLoaded = page.waitForResponse((response) => {
const url = new URL(response.url());
return url.pathname === '/api/resources' && response.request().method() === 'GET';
});
await page.getByRole('button', { name: 'Expand Pulse Assistant' }).click();
await page.getByRole('button', { name: /Ask Pulse Assistant/ }).click();
await expect(page.getByRole('heading', { name: 'Pulse Assistant', exact: true })).toBeVisible();
await resourcesLoaded;
// Mention candidates come from live websocket state; the mock TrueNAS
// system ships app containers on truenas-main.
const textarea = page.getByPlaceholder('Ask about your infrastructure...');
await textarea.click();
await textarea.pressSequentially('@next');
await textarea.pressSequentially('@document');
const mentionSurface = page.locator('[data-mention-autocomplete]');
await expect(mentionSurface.getByText('Resources')).toBeVisible();
await expect(mentionSurface.getByRole('button', { name: /Nextcloud/ })).toBeVisible();
await expect(mentionSurface).toContainText('app-container');
await expect(mentionSurface.getByRole('button', { name: /document-hub/ })).toBeVisible();
await expect(mentionSurface).toContainText('truenas-main');
await mentionSurface.getByRole('button', { name: /Nextcloud/ }).click();
await expect(textarea).toHaveValue('@Nextcloud ');
await mentionSurface.getByRole('button', { name: /document-hub/ }).click();
await expect(textarea).toHaveValue('@document-hub ');
await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });
});