Skip to content

Commit

Permalink
Update dashboard deps (#1590)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Martinez Gotor authored Mar 18, 2020
1 parent 56bb18c commit 215f6e6
Show file tree
Hide file tree
Showing 4 changed files with 831 additions and 887 deletions.
4 changes: 2 additions & 2 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
"react-switch": "^5.0.1",
"react-tabs": "^3.0.0",
"react-test-renderer": "^16.2.0",
"react-tooltip": "^3.10.0",
"react-tooltip": "3.11.1",
"redux": "^4.0.0",
"redux-devtools-extension": "^2.13.5",
"redux-thunk": "^2.2.0",
"semver": "^5.6.0",
"ts-jest": "^22.0.1",
"typesafe-actions": "^2.0.4",
"yaml": "^1.7.1"
"yaml": "1.7.2"
},
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/components/LoginForm/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LoginForm extends React.Component<ILoginFormProps, ILoginFormState> {
return <LoadingWrapper />;
}
if (this.props.authenticated) {
const { from } = this.props.location.state || { from: { pathname: "/" } };
const { from } = (this.props.location.state as any) || { from: { pathname: "/" } };
return <Redirect to={from} />;
}

Expand Down
25 changes: 5 additions & 20 deletions dashboard/src/containers/RoutesContainer/Routes.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { mount, shallow } from "enzyme";
import { createMemoryHistory } from "history";
import * as React from "react";
import { Route, StaticRouter } from "react-router";
import { RouteComponentProps } from "react-router-dom";
import { StaticRouter } from "react-router";
import { Redirect, RouteComponentProps } from "react-router-dom";

import NotFound from "../../components/NotFound";
import RepoListContainer from "../../containers/RepoListContainer";
Expand Down Expand Up @@ -41,12 +41,7 @@ it("should render a redirect to the default namespace", () => {
</StaticRouter>,
);
expect(wrapper.find(NotFound)).not.toExist();
expect(
wrapper
.find(Route)
.props()
.render().props.to,
).toEqual("/apps/ns/default");
expect(wrapper.find(Redirect).prop("to")).toEqual("/apps/ns/default");
});

it("should render a redirect to the login page", () => {
Expand All @@ -56,12 +51,7 @@ it("should render a redirect to the login page", () => {
</StaticRouter>,
);
expect(wrapper.find(NotFound)).not.toExist();
expect(
wrapper
.find(Route)
.props()
.render().props.to,
).toEqual("/login");
expect(wrapper.find(Redirect).prop("to")).toEqual("/login");
});

it("should render a redirect to the login page (when not authenticated)", () => {
Expand All @@ -71,12 +61,7 @@ it("should render a redirect to the login page (when not authenticated)", () =>
</StaticRouter>,
);
expect(wrapper.find(NotFound)).not.toExist();
expect(
wrapper
.find(Route)
.props()
.render().props.to,
).toEqual("/login");
expect(wrapper.find(Redirect).prop("to")).toEqual("/login");
});

describe("Routes depending on feature flags", () => {
Expand Down
Loading

0 comments on commit 215f6e6

Please sign in to comment.