This commit is contained in:
David Langley
2025-12-03 17:44:02 +00:00
parent 9242717b94
commit 7ffcffb1a0
2 changed files with 3 additions and 6 deletions

View File

@@ -42,8 +42,8 @@ const getWinningAnswers = (poll: Poll, responseRelations: Relations): EndedPollS
totalVoteCount,
winningAnswers: poll.pollEvent.answers
.map((answer, index) => ({ answerIndex: index, answer })) // keep track of original answer index
.filter(({answer}) => votes.get(answer.id) === winCount)
.map(({answer, answerIndex}) => ({
.filter(({ answer }) => votes.get(answer.id) === winCount)
.map(({ answer, answerIndex }) => ({
answer,
voteCount: votes.get(answer.id) || 0,
optionNumber: answerIndex + 1,

View File

@@ -205,9 +205,6 @@ describe("<PollListItemEnded />", () => {
// The optionNumber is maintained correctly
const radioInput = pollOption.querySelector('input[type="radio"]');
expect(radioInput).toHaveAttribute(
"aria-label",
expect.stringContaining("Option 3, Toyota Supra MK4"),
);
expect(radioInput).toHaveAttribute("aria-label", expect.stringContaining("Option 3, Toyota Supra MK4"));
});
});