Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlog committed Dec 26, 2019
1 parent dad6c7e commit 3a43db7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
35 changes: 23 additions & 12 deletions x-pack/plugins/endpoint/public/applications/endpoint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import { Route, Router, Switch } from 'react-router-dom';
export function renderApp(coreStart: CoreStart, { appBasePath, element }: AppMountParameters) {
coreStart.http.get('/api/endpoint/hello-world');

const history = createHashHistory()
//const history = createBrowserHistory({ basename: appBasePath })
ReactDOM.render(<AppRoot history={history}/>, element);
const history = createHashHistory();
// const history = createBrowserHistory({ basename: appBasePath })
ReactDOM.render(<AppRoot history={history} />, element);

return () => {
ReactDOM.unmountComponentAtNode(element);
Expand All @@ -30,22 +30,33 @@ interface RouterProps {
history: History;
}

const AppRoot: React.FC<RouterProps> = React.memo(({history}) => (
const AppRoot: React.FC<RouterProps> = React.memo(({ history }) => (
<I18nProvider>
<Router history={history}>
<Switch>
<Route exact path="/" render={() => (
<Router history={history}>
<Switch>
<Route
exact
path="/"
render={() => (
<h1 data-test-subj="welcomeTitle">
<FormattedMessage id="xpack.endpoint.welcomeTitle" defaultMessage="Hello World" />
</h1>
)} />
<Route path="/management" render={() => (
)}
/>
<Route
path="/management"
render={() => (
<h1 data-test-subj="management">
<FormattedMessage id="xpack.endpoint.management" defaultMessage="Manage Endpoints" />
</h1>
)} />
<Route render={() => <FormattedMessage id="xpack.endpoint.notFound" defaultMessage="Page Not Found" />} />
</Switch>
)}
/>
<Route
render={() => (
<FormattedMessage id="xpack.endpoint.notFound" defaultMessage="Page Not Found" />
)}
/>
</Switch>
</Router>
</I18nProvider>
));
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');

describe.only('spaces', () => {
describe('spaces', () => {
describe('space with no features disabled', () => {
before(async () => {
await spacesService.create({
Expand Down Expand Up @@ -44,15 +44,11 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it(`endpoint management shows 'Manage Endpoints'`, async () => {
await pageObjects.common.navigateToActualUrl(
'endpoint',
'/management',
{
basePath: '/s/custom_space',
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
}
);
await pageObjects.common.navigateToActualUrl('endpoint', '/management', {
basePath: '/s/custom_space',
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('management');
});
});
Expand Down

0 comments on commit 3a43db7

Please sign in to comment.