Fix existing tests but 3
This commit is contained in:
parent
6b92c92531
commit
2083213131
5 changed files with 685 additions and 203 deletions
|
@ -367,8 +367,8 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
|||
);
|
||||
})}
|
||||
</div>
|
||||
<div data-testid="totalVotes" className="mx_MPollBody_totalVotes">
|
||||
<span onClick={() => showDetailedVotes()}>{totalText}</span>
|
||||
<div className="mx_MPollBody_totalVotes">
|
||||
<span data-testid="totalVotes" onClick={() => showDetailedVotes()}>{totalText}</span>
|
||||
{isFetchingResponses && <Spinner w={16} h={16} />}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,6 @@ import React, { ReactNode, useContext } from "react";
|
|||
|
||||
import { Icon as TrophyIcon } from "../../../../res/img/element-icons/trophy.svg";
|
||||
import RoomContext from "../../../contexts/RoomContext";
|
||||
import { useRoomMembers } from "../../../hooks/useRoomMembers";
|
||||
import { _t } from "../../../languageHandler";
|
||||
import FacePile from "../elements/FacePile";
|
||||
import StyledRadioButton from "../elements/StyledRadioButton";
|
||||
|
@ -28,13 +27,13 @@ type PollOptionContentProps = {
|
|||
};
|
||||
const PollOptionContent: React.FC<PollOptionContentProps> = ({ isWinner, answer, votes, displayVoteCount }) => {
|
||||
const votesText = displayVoteCount ? _t("timeline|m.poll|count_of_votes", { count: votes.length }) : "";
|
||||
const room = useContext(RoomContext).room!;
|
||||
const members = useRoomMembers(room);
|
||||
const room = useContext(RoomContext).room;
|
||||
const members = room?.getJoinedMembers() || [];
|
||||
|
||||
return (
|
||||
<div className="mx_PollOption_content">
|
||||
<div className="mx_PollOption_optionText">{answer.text}</div>
|
||||
<div className="mx_PollOption_optionVoteCount">
|
||||
<div>
|
||||
<div style={{ display: "flex" }}>
|
||||
{displayVoteCount
|
||||
&& members.length <= MAXIMUM_MEMBERS_FOR_FACE_PILE
|
||||
|
@ -45,7 +44,7 @@ const PollOptionContent: React.FC<PollOptionContentProps> = ({ isWinner, answer,
|
|||
style={{ marginRight: "10px" }}
|
||||
/>
|
||||
}
|
||||
<span>
|
||||
<span className="mx_PollOption_optionVoteCount">
|
||||
{isWinner && <TrophyIcon className="mx_PollOption_winnerIcon" />}
|
||||
{votesText}
|
||||
</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue