Replace react-dom tests with react testing-library tests (#10260)
This commit is contained in:
parent
5398db21ad
commit
e5291c195d
4 changed files with 132 additions and 184 deletions
|
@ -68,8 +68,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class MemberList extends React.Component<IProps, IState> {
|
||||
// XXX: exported for tests
|
||||
public showPresence = true;
|
||||
private readonly showPresence: boolean;
|
||||
private mounted = false;
|
||||
|
||||
public static contextType = SDKContext;
|
||||
|
@ -260,32 +259,6 @@ export default class MemberList extends React.Component<IProps, IState> {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* SHOULD ONLY BE USED BY TESTS
|
||||
*/
|
||||
public memberString(member: RoomMember): string {
|
||||
if (!member) {
|
||||
return "(null)";
|
||||
} else {
|
||||
const u = member.user;
|
||||
return (
|
||||
"(" +
|
||||
member.name +
|
||||
", " +
|
||||
member.powerLevel +
|
||||
", " +
|
||||
(u ? u.lastActiveAgo : "<null>") +
|
||||
", " +
|
||||
(u ? u.getLastActiveTs() : "<null>") +
|
||||
", " +
|
||||
(u ? u.currentlyActive : "<null>") +
|
||||
", " +
|
||||
(u ? u.presence : "<null>") +
|
||||
")"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps: Readonly<IProps>, prevState: Readonly<IState>, snapshot?: any): void {
|
||||
if (prevProps.searchQuery !== this.props.searchQuery) {
|
||||
this.updateListNow(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue