test UserSettingsDialog (#9118)

This commit is contained in:
Kerry
2022-08-01 06:47:13 +00:00
committed by GitHub
parent 82fb21aff5
commit 05cc5f62dd
5 changed files with 321 additions and 4 deletions
@@ -46,7 +46,7 @@ interface IState {
}
export default class UserSettingsDialog extends React.Component<IProps, IState> {
private mjolnirWatcher: string;
private mjolnirWatcher: string | undefined;
constructor(props) {
super(props);
@@ -61,7 +61,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
}
public componentWillUnmount(): void {
SettingsStore.unwatchSetting(this.mjolnirWatcher);
this.mjolnirWatcher && SettingsStore.unwatchSetting(this.mjolnirWatcher);
}
private mjolnirChanged: CallbackFn = (settingName, roomId, atLevel, newValue) => {
@@ -70,7 +70,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
};
private getTabs() {
const tabs = [];
const tabs: Tab[] = [];
tabs.push(new Tab(
UserTab.General,