Skip to content

Commit

Permalink
Ensure Each TestQueueRow Uses a Unique ID-ref. (#370)
Browse files Browse the repository at this point in the history
* Ensure each TestQueueRow uses a unique idref.

* Include Test Plan Run ID in generated row element ID.
  • Loading branch information
jkva authored Feb 1, 2022
1 parent cbe86ff commit 4bbdc17
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions client/components/TestQueueRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,17 @@ const TestQueueRow = ({
const { status, results } = evaluateStatusAndResults();
const nextReportStatus = evaluateNewReportStatus();

const getRowId = tester =>
[
'plan',
testPlanReport.id,
'run',
currentUserTestPlanRun.id,
'assignee',
tester.username,
'completed'
].join('-');

return (
<tr className="test-queue-run-row">
<th>{renderAssignedUserToTestPlan()}</th>
Expand Down Expand Up @@ -392,19 +403,11 @@ const TestQueueRow = ({
// Allows ATs to read the number of
// completed tests when tabbing to this
// link
aria-describedby={
`assignee-${tester.username}-` +
`completed`
}
aria-describedby={getRowId(tester)}
>
{tester.username}
</a>
<div
id={
`assignee-${tester.username}-` +
`completed`
}
>
<div id={getRowId(tester)}>
{`(${testResults.reduce(
(acc, { completedAt }) =>
acc + (completedAt ? 1 : 0),
Expand Down

0 comments on commit 4bbdc17

Please sign in to comment.