Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley committed Feb 17, 2021
1 parent 7bda49d commit b2253ec
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@
"**/minimist": "^1.2.5",
"**/node-jose/node-forge": "^0.10.0",
"**/prismjs": "1.22.0",
"**/react-router": "5.2.0",
"**/react-router-dom": "5.2.0",
"**/react-syntax-highlighter": "^15.3.1",
"**/react-syntax-highlighter/**/highlight.js": "^10.4.1",
"**/request": "^2.88.2",
Expand Down Expand Up @@ -130,6 +128,7 @@
"@kbn/logging": "link:packages/kbn-logging",
"@kbn/monaco": "link:packages/kbn-monaco",
"@kbn/std": "link:packages/kbn-std",
"@kbn/tinymath": "link:packages/kbn-tinymath",
"@kbn/ui-framework": "link:packages/kbn-ui-framework",
"@kbn/ui-shared-deps": "link:packages/kbn-ui-shared-deps",
"@kbn/utils": "link:packages/kbn-utils",
Expand Down Expand Up @@ -313,7 +312,6 @@
"tabbable": "1.1.3",
"tar": "4.4.13",
"tinygradient": "0.4.3",
"@kbn/tinymath": "link:packages/kbn-tinymath",
"tree-kill": "^1.2.2",
"ts-easing": "^0.2.0",
"tslib": "^2.0.0",
Expand Down Expand Up @@ -391,10 +389,10 @@
"@scant/router": "^0.1.0",
"@storybook/addon-a11y": "^6.0.26",
"@storybook/addon-actions": "^6.0.26",
"@storybook/addon-docs": "^6.0.26",
"@storybook/addon-essentials": "^6.0.26",
"@storybook/addon-knobs": "^6.0.26",
"@storybook/addon-storyshots": "^6.0.26",
"@storybook/addon-docs": "^6.0.26",
"@storybook/components": "^6.0.26",
"@storybook/core": "^6.0.26",
"@storybook/core-events": "^6.0.26",
Expand Down Expand Up @@ -761,6 +759,7 @@
"postcss-loader": "^3.0.0",
"postcss-prefix-selector": "^1.7.2",
"prettier": "^2.2.0",
"pretty-format": "^26.6.2",
"pretty-ms": "5.0.0",
"proxyquire": "1.8.0",
"querystring": "^0.2.0",
Expand Down Expand Up @@ -834,8 +833,8 @@
"val-loader": "^1.1.1",
"vega": "^5.19.1",
"vega-lite": "^4.17.0",
"vega-spec-injector": "^0.0.2",
"vega-schema-url-parser": "^2.1.0",
"vega-spec-injector": "^0.0.2",
"vega-tooltip": "^0.25.0",
"venn.js": "0.2.20",
"vinyl-fs": "^3.0.3",
Expand All @@ -852,4 +851,4 @@
"yargs": "^15.4.1",
"zlib": "^1.0.5"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { get } from 'lodash';
import React from 'react';

import { EuiLink } from '@elastic/eui';
import { Link, withRouter, RouteComponentProps } from 'react-router';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import { Link } from 'react-router-dom';

interface ConnectedLinkComponent extends RouteComponentProps {
location: any;
Expand Down
20 changes: 18 additions & 2 deletions x-pack/plugins/observability/public/utils/test_helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { AppMountParameters, CoreStart } from 'kibana/public';
import React from 'react';
import { IntlProvider } from 'react-intl';
import { of } from 'rxjs';
import { queries, Queries, BoundFunction } from '@testing-library/dom';
import { OptionsReceived as PrettyFormatOptions } from 'pretty-format';
import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public';
import translations from '../../../translations/translations/ja-JP.json';
import { PluginContext } from '../context/plugin_context';
Expand All @@ -18,6 +20,20 @@ import { EuiThemeProvider } from '../../../../../src/plugins/kibana_react/common

const appMountParameters = ({ setHeaderActionMenu: () => {} } as unknown) as AppMountParameters;

// from node_modules/@testing-library/react/types/index.d.ts
type RenderResult<Q extends Queries = typeof queries> = {
container: HTMLElement;
baseElement: HTMLElement;
debug: (
baseElement?: HTMLElement | DocumentFragment | Array<HTMLElement | DocumentFragment>,
maxLength?: number,
options?: PrettyFormatOptions
) => void;
rerender: (ui: React.ReactElement) => void;
unmount: () => boolean;
asFragment: () => DocumentFragment;
} & { [P in keyof Q]: BoundFunction<Q[P]> };

export const core = ({
http: {
basePath: {
Expand All @@ -34,7 +50,7 @@ const plugins = ({
data: { query: { timefilter: { timefilter: { setTime: jest.fn() } } } },
} as unknown) as ObservabilityPluginSetupDeps;

export const render = (component: React.ReactNode) => {
export const render = (((component: React.ReactNode) => {
return testLibRender(
<IntlProvider locale="en-US" messages={translations.messages}>
<KibanaContextProvider services={{ ...core }}>
Expand All @@ -44,4 +60,4 @@ export const render = (component: React.ReactNode) => {
</KibanaContextProvider>
</IntlProvider>
);
};
}) as unknown) as RenderResult;
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24354,7 +24354,7 @@ react-reverse-portal@^1.0.4:
resolved "https://registry.yarnpkg.com/react-reverse-portal/-/react-reverse-portal-1.0.4.tgz#d127d2c9147549b25c4959aba1802eca4b144cd4"
integrity sha512-WESex/wSjxHwdG7M0uwPNkdQXaLauXNHi4INQiRybmFIXVzAqgf/Ak2OzJ4MLf4UuCD/IzEwJOkML2SxnnontA==

react-router-dom@5.2.0, react-router-dom@^5.2.0:
react-router-dom@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
Expand Down

0 comments on commit b2253ec

Please sign in to comment.