Files
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

74 lines
3.1 KiB
TypeScript

import { InsightPage } from '../../page-models/insightPage'
import { randomString } from '../../utils'
import { PlaywrightWorkspaceSetupResult, expect, test } from '../../utils/workspace-test-base'
test.describe('Insights list', () => {
let workspace: PlaywrightWorkspaceSetupResult | null = null
test.beforeAll(async ({ playwrightSetup }) => {
workspace = await playwrightSetup.createWorkspace({ use_current_time: true, skip_onboarding: true })
})
test.beforeEach(async ({ page, playwrightSetup }) => {
await playwrightSetup.login(page, workspace!)
})
test('Can create, search, and open an insight', async ({ page }) => {
const insight = new InsightPage(page)
const insightName = randomString('list-test')
await test.step('create and save a new Trends insight', async () => {
await insight.goToNewTrends()
await insight.trends.waitForChart()
await insight.editName(insightName)
await insight.save()
await expect(insight.editButton).toBeVisible()
})
await test.step('search for the insight and navigate to it', async () => {
await insight.goToList()
await page.getByPlaceholder('Search').fill(insightName)
// Wait for the table to settle with exactly one row containing our insight.
// This avoids a race where the search API response arrives mid-click,
// re-rendering the table and detaching the link element before navigation fires.
const rows = page.locator('table tbody tr')
await expect(rows).toHaveCount(1, { timeout: 10_000 })
const link = rows.first().getByRole('link', { name: insightName })
await expect(link).toBeVisible()
await link.click()
await expect(insight.topBarName).toContainText(insightName, { timeout: 15_000 })
})
})
test('Can delete an insight from the list', async ({ page }) => {
const insight = new InsightPage(page)
const insightName = randomString('to-delete')
await test.step('create an insight', async () => {
await insight.goToNewTrends()
await insight.trends.waitForChart()
await insight.editName(insightName)
await insight.save()
})
await test.step('delete the insight via row menu', async () => {
await insight.goToList()
await page.getByPlaceholder('Search').fill(insightName)
await expect(page.getByText(insightName)).toBeVisible()
await page.locator('table tbody tr').first().hover()
await page.locator('table tbody tr').first().getByTestId('more-button').click()
await page.getByRole('button', { name: 'Delete' }).click()
const dialog = page.locator('.Modal').filter({ hasText: 'Delete insight?' })
await dialog.getByRole('button', { name: 'Delete' }).click()
})
await test.step('verify the insight is removed', async () => {
await expect(page.getByText('There are no insights matching')).toBeVisible()
})
})
})