mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
improve module unit tests
This commit is contained in:
@@ -12,12 +12,13 @@ import PrimaryNavigation from "../components/PrimaryNavigation";
|
||||
import Loading from "../components/Loading";
|
||||
import Notification from "../components/Notification";
|
||||
import Footer from "../components/Footer";
|
||||
import ErrorNotification from "../components/ErrorNotification";
|
||||
|
||||
type Props = {
|
||||
login: boolean,
|
||||
me: any,
|
||||
fetchMe: () => void,
|
||||
loading: boolean
|
||||
error: Error,
|
||||
loading: boolean,
|
||||
fetchMe: () => void
|
||||
};
|
||||
|
||||
class App extends Component<Props> {
|
||||
@@ -25,13 +26,16 @@ class App extends Component<Props> {
|
||||
this.props.fetchMe();
|
||||
}
|
||||
render() {
|
||||
const { me, loading } = this.props;
|
||||
const { me, loading, error } = this.props;
|
||||
|
||||
let content = [];
|
||||
let navigation;
|
||||
|
||||
if (loading) {
|
||||
content.push(<Loading />);
|
||||
} else if (error) {
|
||||
// TODO add error page instead of plain notification
|
||||
content.push(<ErrorNotification error={error} />);
|
||||
} else if (!me) {
|
||||
content.push(<Login />);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user