Remove usage of legacyRoot in RTL tests (#28485)

* Remove usage of legacyRoot in RTL tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-11-20 18:09:51 +00:00 committed by GitHub
parent d5c111f656
commit 95630f525f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 40 additions and 38 deletions

View file

@ -113,16 +113,16 @@ export default class ForgotPassword extends React.Component<Props, State> {
this.unmounted = true;
}
private async checkServerLiveliness(serverConfig: ValidatedServerConfig): Promise<void> {
private async checkServerLiveliness(serverConfig: ValidatedServerConfig): Promise<boolean> {
try {
await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(serverConfig.hsUrl, serverConfig.isUrl);
if (this.unmounted) return;
if (this.unmounted) return false;
this.setState({
serverIsAlive: true,
});
} catch (e: any) {
if (this.unmounted) return;
if (this.unmounted) return false;
const { serverIsAlive, serverDeadError } = AutoDiscoveryUtils.authComponentStateForError(
e,
"forgot_password",
@ -131,7 +131,9 @@ export default class ForgotPassword extends React.Component<Props, State> {
serverIsAlive,
errorText: serverDeadError,
});
return serverIsAlive;
}
return true;
}
private async onPhaseEmailInputSubmit(): Promise<void> {
@ -299,10 +301,10 @@ export default class ForgotPassword extends React.Component<Props, State> {
});
// Refresh the server errors. Just in case the server came back online of went offline.
await this.checkServerLiveliness(this.props.serverConfig);
const serverIsAlive = await this.checkServerLiveliness(this.props.serverConfig);
// Server error
if (!this.state.serverIsAlive) return;
if (!serverIsAlive) return;
switch (this.state.phase) {
case Phase.EnterEmail: