Fix remaining existing tests

This commit is contained in:
Tim Vahlbrock 2024-11-01 12:37:37 +01:00
parent 2083213131
commit 22729f4513
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -244,7 +244,7 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
if (!this.state.voteRelations || !this.context) { if (!this.state.voteRelations || !this.context) {
return new Map<string, UserVote>(); return new Map<string, UserVote>();
} }
return collectUserVotes(allVotes(this.state.voteRelations), null, this.state.selected); return collectUserVotes(allVotes(this.state.voteRelations), this.context.getUserId(), this.state.selected);
} }
/** /**

View file

@ -425,7 +425,7 @@ describe("MPollBody", () => {
expect(endedVotesCount(renderResult, "poutine")).toBe("1 vote"); expect(endedVotesCount(renderResult, "poutine")).toBe("1 vote");
expect(endedVotesCount(renderResult, "italian")).toBe("0 votes"); expect(endedVotesCount(renderResult, "italian")).toBe("0 votes");
expect(endedVotesCount(renderResult, "wings")).toBe("1 vote"); expect(endedVotesCount(renderResult, "wings")).toBe("1 vote");
expect(renderResult.getByTestId("totalVotes").innerHTML).toBe("Final result based on 5 votes"); expect(renderResult.getByTestId("totalVotes").innerHTML).toBe("Final result based on 5 votes. Click here to see full results");
}); });
it("sends a vote event when I choose an option", async () => { it("sends a vote event when I choose an option", async () => {