Add a serverConfig property to MatrixChat for unit tests
This commit is contained in:
parent
4ada66d319
commit
58b9eb4cb2
1 changed files with 3 additions and 0 deletions
|
@ -50,6 +50,7 @@ import SettingsStore, {SettingLevel} from "../../settings/SettingsStore";
|
||||||
import { startAnyRegistrationFlow } from "../../Registration.js";
|
import { startAnyRegistrationFlow } from "../../Registration.js";
|
||||||
import { messageForSyncError } from '../../utils/ErrorUtils';
|
import { messageForSyncError } from '../../utils/ErrorUtils';
|
||||||
import ResizeNotifier from "../../utils/ResizeNotifier";
|
import ResizeNotifier from "../../utils/ResizeNotifier";
|
||||||
|
import {ValidatedServerConfig} from "../../utils/AutoDiscoveryUtils";
|
||||||
|
|
||||||
// Disable warnings for now: we use deprecated bluebird functions
|
// Disable warnings for now: we use deprecated bluebird functions
|
||||||
// and need to migrate, but they spam the console with warnings.
|
// and need to migrate, but they spam the console with warnings.
|
||||||
|
@ -107,6 +108,7 @@ export default React.createClass({
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
config: PropTypes.object,
|
config: PropTypes.object,
|
||||||
|
serverConfig: PropTypes.instanceOf(ValidatedServerConfig),
|
||||||
ConferenceHandler: PropTypes.any,
|
ConferenceHandler: PropTypes.any,
|
||||||
onNewScreen: PropTypes.func,
|
onNewScreen: PropTypes.func,
|
||||||
registrationUrl: PropTypes.string,
|
registrationUrl: PropTypes.string,
|
||||||
|
@ -208,6 +210,7 @@ export default React.createClass({
|
||||||
|
|
||||||
getServerProperties() {
|
getServerProperties() {
|
||||||
let props = this.state.serverConfig;
|
let props = this.state.serverConfig;
|
||||||
|
if (!props) props = this.props.serverConfig; // for unit tests
|
||||||
if (!props) props = SdkConfig.get()["validated_server_config"];
|
if (!props) props = SdkConfig.get()["validated_server_config"];
|
||||||
return {serverConfig: props};
|
return {serverConfig: props};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue