diff --git a/web/e2e/publish-flow-ui.spec.ts b/web/e2e/publish-flow-ui.spec.ts index 867c8248..d1e325ce 100644 --- a/web/e2e/publish-flow-ui.spec.ts +++ b/web/e2e/publish-flow-ui.spec.ts @@ -35,7 +35,7 @@ test.describe('Publish Flow UI (Real API)', () => { const namespaceTrigger = page.locator('#namespace') await expect(namespaceTrigger).toBeVisible() await namespaceTrigger.click() - const namespaceOption = page.getByRole('option', { + const namespaceOption = page.getByRole('dialog').getByRole('button', { name: new RegExp(`\\(@${namespace.slug}\\)`), }).first() await expect(namespaceOption).toBeVisible() diff --git a/web/src/pages/dashboard/publish.tsx b/web/src/pages/dashboard/publish.tsx index c921b5e1..2fc2d8d5 100644 --- a/web/src/pages/dashboard/publish.tsx +++ b/web/src/pages/dashboard/publish.tsx @@ -163,8 +163,9 @@ export function PublishPage() {
- + { }, true) }) + it('forwards the trigger id for labels and stable form selectors', () => { + render() + + expect(document.getElementById('namespace')).toBe( + screen.getByRole('button', { name: 'namespacePicker.placeholder' }), + ) + }) + it('paginates bounded results and emits the selected slug', () => { const onValueChange = vi.fn() render() diff --git a/web/src/shared/components/namespace-picker.tsx b/web/src/shared/components/namespace-picker.tsx index e8a7007c..ab918629 100644 --- a/web/src/shared/components/namespace-picker.tsx +++ b/web/src/shared/components/namespace-picker.tsx @@ -16,6 +16,7 @@ import { useMyNamespacesPage } from '@/shared/hooks/use-namespace-queries' const PAGE_SIZE = 20 interface NamespacePickerProps { + id?: string value: string onValueChange: (slug: string) => void status?: 'ACTIVE' | 'FROZEN' | 'ARCHIVED' @@ -27,6 +28,7 @@ interface NamespacePickerProps { * Server-paged namespace selector that keeps request and render size bounded. */ export function NamespacePicker({ + id, value, onValueChange, status, @@ -58,7 +60,7 @@ export function NamespacePicker({ return ( -