Skip to content

Commit

Permalink
fixed typechecks
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Dec 7, 2020
1 parent 74d3b5d commit 4ddc524
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,14 @@ describe('alert_form', () => {
let wrapper: ReactWrapper<any>;

beforeEach(async () => {
const coreStart = coreMock.createStart();
alertTypeRegistry.list.mockReturnValue([alertType]);
alertTypeRegistry.get.mockReturnValue(alertType);
alertTypeRegistry.has.mockReturnValue(true);
actionTypeRegistry.list.mockReturnValue([actionType]);
actionTypeRegistry.has.mockReturnValue(true);
actionTypeRegistry.get.mockReturnValue(actionType);

const monitoringDependencies = {
toastNotifications: coreStart.notifications.toasts,
...Legacy.shims.kibanaServices,
actionTypeRegistry,
alertTypeRegistry,
} as any;
const KibanaReactContext = createKibanaReactContext(Legacy.shims.kibanaServices);

const initialAlert = ({
name: 'test',
Expand All @@ -130,14 +124,18 @@ describe('alert_form', () => {
} as unknown) as Alert;

wrapper = mountWithIntl(
<AlertForm
alert={initialAlert}
dispatch={() => {}}
errors={{ name: [], interval: [] }}
operation="create"
actionTypeRegistry={actionTypeRegistry}
alertTypeRegistry={alertTypeRegistry}
/>
<I18nProvider>
<KibanaReactContext.Provider>
<AlertForm
alert={initialAlert}
dispatch={() => {}}
errors={{ name: [], interval: [] }}
operation="create"
actionTypeRegistry={actionTypeRegistry}
alertTypeRegistry={alertTypeRegistry}
/>
</KibanaReactContext.Provider>
</I18nProvider>
);

await act(async () => {
Expand Down

0 comments on commit 4ddc524

Please sign in to comment.