You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-20 20:42:03 +03:00
convert MPollBody tests into rtl (#9906)
* convert MPollBody tests into rtl * strict fixes * more strict * more semantic assertions * update types for extensible events changes
This commit is contained in:
@@ -448,7 +448,7 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
||||
|
||||
return (
|
||||
<div className="mx_MPollBody">
|
||||
<h2>
|
||||
<h2 data-testid="pollQuestion">
|
||||
{poll.question.text}
|
||||
{editedSpan}
|
||||
</h2>
|
||||
@@ -471,7 +471,12 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
||||
|
||||
const answerPercent = totalVotes === 0 ? 0 : Math.round((100.0 * answerVotes) / totalVotes);
|
||||
return (
|
||||
<div key={answer.id} className={cls} onClick={() => this.selectOption(answer.id)}>
|
||||
<div
|
||||
data-testid={`pollOption-${answer.id}`}
|
||||
key={answer.id}
|
||||
className={cls}
|
||||
onClick={() => this.selectOption(answer.id)}
|
||||
>
|
||||
{ended ? (
|
||||
<EndedPollOption answer={answer} checked={checked} votesText={votesText} />
|
||||
) : (
|
||||
@@ -493,7 +498,9 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className="mx_MPollBody_totalVotes">{totalText}</div>
|
||||
<div data-testid="totalVotes" className="mx_MPollBody_totalVotes">
|
||||
{totalText}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user