Skip to content

Commit 4ddc524

Browse files
committed
fixed typechecks
1 parent 74d3b5d commit 4ddc524

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,14 @@ describe('alert_form', () => {
9999
let wrapper: ReactWrapper<any>;
100100

101101
beforeEach(async () => {
102-
const coreStart = coreMock.createStart();
103102
alertTypeRegistry.list.mockReturnValue([alertType]);
104103
alertTypeRegistry.get.mockReturnValue(alertType);
105104
alertTypeRegistry.has.mockReturnValue(true);
106105
actionTypeRegistry.list.mockReturnValue([actionType]);
107106
actionTypeRegistry.has.mockReturnValue(true);
108107
actionTypeRegistry.get.mockReturnValue(actionType);
109108

110-
const monitoringDependencies = {
111-
toastNotifications: coreStart.notifications.toasts,
112-
...Legacy.shims.kibanaServices,
113-
actionTypeRegistry,
114-
alertTypeRegistry,
115-
} as any;
109+
const KibanaReactContext = createKibanaReactContext(Legacy.shims.kibanaServices);
116110

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

132126
wrapper = mountWithIntl(
133-
<AlertForm
134-
alert={initialAlert}
135-
dispatch={() => {}}
136-
errors={{ name: [], interval: [] }}
137-
operation="create"
138-
actionTypeRegistry={actionTypeRegistry}
139-
alertTypeRegistry={alertTypeRegistry}
140-
/>
127+
<I18nProvider>
128+
<KibanaReactContext.Provider>
129+
<AlertForm
130+
alert={initialAlert}
131+
dispatch={() => {}}
132+
errors={{ name: [], interval: [] }}
133+
operation="create"
134+
actionTypeRegistry={actionTypeRegistry}
135+
alertTypeRegistry={alertTypeRegistry}
136+
/>
137+
</KibanaReactContext.Provider>
138+
</I18nProvider>
141139
);
142140

143141
await act(async () => {

0 commit comments

Comments
 (0)