Add test for failed to load URL
This commit is contained in:
parent
1fad30aed7
commit
1ccb7cebce
|
@ -306,7 +306,7 @@ var MattermostView = React.createClass({
|
||||||
if (this.state.did_fail_load === null) {
|
if (this.state.did_fail_load === null) {
|
||||||
return (<webview id={ this.props.id } className="mattermostView" style={ this.props.style } preload="webview/mattermost.js" src={ this.props.src } ref="webview"></webview>);
|
return (<webview id={ this.props.id } className="mattermostView" style={ this.props.style } preload="webview/mattermost.js" src={ this.props.src } ref="webview"></webview>);
|
||||||
} else {
|
} else {
|
||||||
return (<ErrorView errorInfo={ this.state.did_fail_load } style={ this.props.style }></ErrorView>)
|
return (<ErrorView id={ this.props.id + '-fail' } className="errorView" errorInfo={ this.state.did_fail_load } style={ this.props.style }></ErrorView>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -316,7 +316,7 @@ var MattermostView = React.createClass({
|
||||||
var ErrorView = React.createClass({
|
var ErrorView = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<Grid fluid style={ this.props.style }>
|
<Grid id={ this.props.id } style={ this.props.style }>
|
||||||
<h1>Failed to load the URL</h1>
|
<h1>Failed to load the URL</h1>
|
||||||
<p>
|
<p>
|
||||||
{ 'URL: ' }
|
{ 'URL: ' }
|
||||||
|
|
|
@ -166,6 +166,21 @@ describe('electron-mattermost', function() {
|
||||||
})
|
})
|
||||||
.end();
|
.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show error when using incorrect URL', function() {
|
||||||
|
this.timeout(30000)
|
||||||
|
fs.writeFileSync(config_file_path, JSON.stringify({
|
||||||
|
version: 1,
|
||||||
|
teams: [{
|
||||||
|
name: 'error_1',
|
||||||
|
url: 'http://false'
|
||||||
|
}]
|
||||||
|
}));
|
||||||
|
return client
|
||||||
|
.init()
|
||||||
|
.waitForVisible('#mattermostView0-fail', 20000)
|
||||||
|
.end();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('settings.html', function() {
|
describe('settings.html', function() {
|
||||||
|
|
Loading…
Reference in a new issue