Summary
Two different elements carry data-testid="subject-table", and both are in the DOM at once whenever the Table tab is active, so page.getByTestId('subject-table') is ambiguous.
Where
apps/web/src/routes/_app/datahub/$subjectId/route.tsx — the "Table" tab <Link>
apps/web/src/routes/_app/datahub/$subjectId/table/index.tsx — the <DataTable> itself
Suggested fix
Rename one of them — e.g. subject-table-tab for the link, leaving subject-table on the table.
Notes
Found while writing the Playwright suite (branch e2e-tests), which works around it with data-table-body / data-table-row and role-based tab links.
Summary
Two different elements carry
data-testid="subject-table", and both are in the DOM at once whenever the Table tab is active, sopage.getByTestId('subject-table')is ambiguous.Where
apps/web/src/routes/_app/datahub/$subjectId/route.tsx— the "Table" tab<Link>apps/web/src/routes/_app/datahub/$subjectId/table/index.tsx— the<DataTable>itselfSuggested fix
Rename one of them — e.g.
subject-table-tabfor the link, leavingsubject-tableon the table.Notes
Found while writing the Playwright suite (branch
e2e-tests), which works around it withdata-table-body/data-table-rowand role-based tab links.