Skip to content

Commit d3206e7

Browse files
ref(dynamic-sampling): Add aria-label to project rate input
Add an accessible label to each project's sample rate input so screen readers can identify which project the input belongs to. Update the test helper to query by this label instead of relying on positional spinbutton indexing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 88802e9 commit d3206e7

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

static/app/views/settings/dynamicSampling/projectSampling.spec.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,10 @@ describe('ProjectSampling', () => {
5858
});
5959
});
6060

61-
function getProjectRateInput() {
62-
// The first spinbutton is the org rate, the second is the project rate
63-
const inputs = screen.getAllByRole('spinbutton');
64-
return inputs[inputs.length - 1]!;
65-
}
66-
6761
async function waitForProjectRateInput() {
68-
// Wait for the project table to render — the ProjectBadge component
69-
// renders a link with this accessible name
70-
await screen.findByRole('link', {name: 'View Project Details'});
71-
return getProjectRateInput();
62+
return screen.findByRole('spinbutton', {
63+
name: 'Sample rate for project-slug',
64+
});
7265
}
7366

7467
it('renders project rate inputs with initial values', async () => {

static/app/views/settings/dynamicSampling/projectsTable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ const TableRow = memo(function TableRow({
394394
onChange={handleChange}
395395
size="sm"
396396
value={sampleRate}
397+
aria-label={t('Sample rate for %s', project.slug)}
397398
/>
398399
</Tooltip>
399400
</FirstCellLine>

0 commit comments

Comments
 (0)