Fix Each child in a list should have a unique "key" prop warnings in unit tests

This commit is contained in:
mabashian
2021-04-27 16:09:43 -04:00
parent 24a903142a
commit 61f0edc5e8
2 changed files with 17 additions and 17 deletions

View File

@@ -58,13 +58,13 @@ function JobListCancelButton({ i18n, jobsToCancel, onCancel }) {
one="You do not have permission to cancel the following job:" one="You do not have permission to cancel the following job:"
other="You do not have permission to cancel the following jobs:" other="You do not have permission to cancel the following jobs:"
/> />
{cannotCancelPermissions.map((job, i) => {cannotCancelPermissions.map((job, i) => (
i === cannotCancelPermissions.length - 1 ? ( <strong key={job}>
<strong> {job}</strong> {' '}
) : ( {job}
<strong> {job},</strong> {i !== cannotCancelPermissions.length - 1 ? ',' : ''}
) </strong>
)} ))}
</div> </div>
)} )}
{cannotCancelNotRunning.length > 0 && ( {cannotCancelNotRunning.length > 0 && (
@@ -74,13 +74,13 @@ function JobListCancelButton({ i18n, jobsToCancel, onCancel }) {
one="You cannot cancel the following job because it is not running:" one="You cannot cancel the following job because it is not running:"
other="You cannot cancel the following jobs because they are not running:" other="You cannot cancel the following jobs because they are not running:"
/> />
{cannotCancelNotRunning.map((job, i) => {cannotCancelNotRunning.map((job, i) => (
i === cannotCancelNotRunning.length - 1 ? ( <strong key={job}>
<strong> {job}</strong> {' '}
) : ( {job}
<strong> {job},</strong> {i !== cannotCancelNotRunning.length - 1 ? ',' : ''}
) </strong>
)} ))}
</div> </div>
)} )}
</div> </div>

View File

@@ -82,9 +82,9 @@ function ScheduleListItem({
{Boolean(isMissingInventory || isMissingSurvey) && ( {Boolean(isMissingInventory || isMissingSurvey) && (
<span> <span>
<Tooltip <Tooltip
content={[isMissingInventory, isMissingSurvey].map(message => ( content={[isMissingInventory, isMissingSurvey].map(message =>
<div key={message}>{message}</div> message ? <div key={message}>{message}</div> : null
))} )}
position="right" position="right"
> >
<ExclamationTriangleIcon /> <ExclamationTriangleIcon />