Skip to content

Commit

Permalink
fix type check, use FunctionComponent as oppsed to FC
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlog committed Dec 27, 2019
1 parent eff2be6 commit 1d5221e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 16 additions & 7 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
const defaultTryTimeout = config.get('timeouts.try');
const defaultFindTimeout = config.get('timeouts.find');

interface NavigateProps {
appConfig: {};
ensureCurrentUrl: boolean;
shouldLoginIfPrompted: boolean;
shouldAcceptAlert: boolean;
useActualUrl: boolean;
}

class CommonPage {
/**
* Navigates the browser window to provided URL
Expand Down Expand Up @@ -115,13 +123,14 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
return currentUrl;
}

private async navigate({
appConfig,
ensureCurrentUrl,
shouldLoginIfPrompted,
shouldAcceptAlert,
useActualUrl,
} = {}) {
private async navigate(navigateProps: NavigateProps) {
const {
appConfig,
ensureCurrentUrl,
shouldLoginIfPrompted,
shouldAcceptAlert,
useActualUrl,
} = navigateProps;
const appUrl = getUrl.noAuth(config.get('servers.kibana'), appConfig);

await retry.try(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface RouterProps {
history: History;
}

const AppRoot: React.FC<RouterProps> = React.memo(({ history }) => (
const AppRoot: React.FunctionComponent<RouterProps> = React.memo(({ history }) => (
<I18nProvider>
<Router history={history}>
<Switch>
Expand Down

0 comments on commit 1d5221e

Please sign in to comment.