Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Each TestQueueRow Uses a Unique ID-ref. #370

Merged
merged 2 commits into from
Feb 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 13 additions & 10 deletions client/components/TestQueueRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,17 @@ const TestQueueRow = ({
const { status, results } = evaluateStatusAndResults();
const nextReportStatus = evaluateNewReportStatus();

const getRowId = tester =>
[
'plan',
testPlanReport.id,
'run',
currentUserTestPlanRun.id,
'assignee',
tester.username,
'completed'
Copy link
Contributor

@howard-e howard-e Jan 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional nitpick to address: I understand the id's original structure was being preserved with -completed being appended. Taking another look again at its use, perhaps something like -completed-tests is clearer for the id's purpose, but removing -completed altogether also works well and is helpful to reduce some of the id's verbosity.

].join('-');

return (
<tr className="test-queue-run-row">
<th>{renderAssignedUserToTestPlan()}</th>
Expand Down Expand Up @@ -378,19 +389,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