refactor: clarify investigation map as ux placeholder

This commit is contained in:
2026-08-05 10:20:28 +01:00
parent ce673b8eb4
commit 86d9bc3f48
4 changed files with 76 additions and 61 deletions
+18 -22
View File
@@ -371,7 +371,7 @@ test("update submission replaces response panel with loading card, preserves con
/* ═══════ Test: investigation map appears and evolves across turns ═ */
test("investigation map: appears after start, topics evolve across mocked turns", async ({ page }) => {
test("investigation map preview: appears after start, topics evolve across mocked turns", async ({ page }) => {
await page.goto("/");
await page.evaluate(() => {
@@ -387,24 +387,22 @@ test("investigation map: appears after start, topics evolve across mocked turns"
await waitForLoading(page);
await waitForWorkspaceReady(page);
// Verify the investigation map card is present after start
const mapCard = page.locator('[aria-label="Investigation map"]');
// Verify the investigation map preview card is present after start
const mapCard = page.locator('[aria-label="Investigation map preview"]');
await expect(mapCard).toBeVisible();
// Map heading visible
await expect(mapCard.getByRole("heading", { name: "Investigation Map" })).toBeVisible();
// Preview heading visible
await expect(mapCard.getByRole("heading", { name: "Investigation Map Preview" })).toBeVisible();
// Helper text visible
await expect(mapCard.getByText(/building an understanding/i)).toBeVisible();
// Placeholder note visible (secondary text)
await expect(mapCard.getByText(/This preview shows where a future reasoning map/i)).toBeVisible();
// At turn 0 (initial analysis): one topic established, one current, rest unknown
const establishedTopics = page.locator('[data-testid="map-topic-established"]');
const currentTopics = page.locator('[data-testid="map-topic-current"]');
const unknownTopics = page.locator('[data-testid="map-topic-unknown"]');
// Helper for counting topics by status across turns
const byStatus = (status) => page.locator(`[data-testid="map-topic-${status}"]`);
await expect(establishedTopics).toHaveCount(1);
await expect(currentTopics).toHaveCount(1);
await expect(unknownTopics).toHaveCount(6);
// At turn 0: one established + one current (≤5 neutral placeholder topics total)
await expect(byStatus("established")).toHaveCount(1);
await expect(byStatus("current")).toHaveCount(1);
// Submit first answer → turn 1: one more established, next topic becomes current
const answerTextarea = page.locator('textarea[placeholder*=Answer]');
@@ -418,10 +416,9 @@ test("investigation map: appears after start, topics evolve across mocked turns"
// Current investigation remains visible (context preserved)
await expect(page.getByRole("heading", { name: "Current investigation" })).toBeVisible({ timeout: 5_000 });
// Map should update: 2 established, 1 current, 5 unknown
await expect(establishedTopics).toHaveCount(2);
await expect(currentTopics).toHaveCount(1);
await expect(unknownTopics).toHaveCount(5);
// Map updated: established count increased, current still present (state shift across turns)
await expect(byStatus("established")).toHaveCount(2);
await expect(byStatus("current")).toHaveCount(1);
// Submit second answer → turn 2
const answerTextarea2 = page.locator('textarea[placeholder*=Answer]');
@@ -432,10 +429,9 @@ test("investigation map: appears after start, topics evolve across mocked turns"
await waitForLoading(page);
await waitForWorkspaceReady(page);
// After second update: 3 established, current shifts again
await expect(establishedTopics).toHaveCount(3);
await expect(currentTopics).toHaveCount(1);
await expect(unknownTopics).toHaveCount(4);
// After second update: established count increased again (current shifted)
await expect(byStatus("established")).toHaveCount(3);
await expect(byStatus("current")).toHaveCount(1);
}
}
});