Skip to content

Commit

Permalink
fixing types
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Oct 2, 2020
1 parent 6a2f79f commit 8abf2d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { makeDecorator } from '@storybook/addons';
import { storiesOf } from '@storybook/react';
import { AppMountContext } from 'kibana/public';
import { AppMountContext, CoreStart } from 'kibana/public';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { UI_SETTINGS } from '../../../../../../src/plugins/data/public';
Expand Down Expand Up @@ -36,7 +36,7 @@ const withCore = makeDecorator({

return (
<MemoryRouter>
<PluginContext.Provider value={{ core: options as AppMountContext['core'] }}>
<PluginContext.Provider value={{ core: options as CoreStart }}>
<EuiThemeProvider>{storyFn(context)}</EuiThemeProvider>
</PluginContext.Provider>
</MemoryRouter>
Expand Down Expand Up @@ -119,23 +119,23 @@ const core = ({
return euiSettings[key];
},
},
} as unknown) as AppMountContext['core'];
} as unknown) as CoreStart;

const coreWithAlerts = ({
...core,
http: {
...core.http,
get: alertsFetchData,
},
} as unknown) as AppMountContext['core'];
} as unknown) as CoreStart;

const coreWithNewsFeed = ({
...core,
http: {
...core.http,
get: newsFeedFetchData,
},
} as unknown) as AppMountContext['core'];
} as unknown) as CoreStart;

const coreAlertsThrowsError = ({
...core,
Expand All @@ -145,7 +145,7 @@ const coreAlertsThrowsError = ({
throw new Error('Error fetching Alerts data');
},
},
} as unknown) as AppMountContext['core'];
} as unknown) as CoreStart;

storiesOf('app/Overview', module)
.addDecorator(withCore(core))
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/observability/public/utils/test_helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import React from 'react';
import { render as testLibRender } from '@testing-library/react';
import { AppMountContext } from 'kibana/public';
import { CoreStart } from 'kibana/public';
import { PluginContext } from '../context/plugin_context';
import { EuiThemeProvider } from '../typings';

Expand All @@ -15,7 +15,7 @@ export const core = ({
prepend: jest.fn(),
},
},
} as unknown) as AppMountContext['core'];
} as unknown) as CoreStart;

export const render = (component: React.ReactNode) => {
return testLibRender(
Expand Down

0 comments on commit 8abf2d5

Please sign in to comment.