Skip to content

Commit caa010d

Browse files
committed
fix type
1 parent 319f00a commit caa010d

2 files changed

Lines changed: 0 additions & 107 deletions

File tree

x-pack/platform/plugins/shared/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.test.tsx

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -222,112 +222,6 @@ describe('connector_add_flyout', () => {
222222
});
223223
});
224224

225-
describe('filtering', () => {
226-
const onActionTypeChange = jest.fn();
227-
228-
const actionType1 = actionTypeRegistryMock.createMockActionTypeModel({
229-
id: 'action-type-1',
230-
iconClass: 'test',
231-
selectMessage: 'Select Test1',
232-
validateParams: (): Promise<GenericValidationResult<unknown>> => {
233-
const validationResult = { errors: {} };
234-
return Promise.resolve(validationResult);
235-
},
236-
actionConnectorFields: null,
237-
});
238-
239-
const actionType2 = actionTypeRegistryMock.createMockActionTypeModel({
240-
id: 'action-type-2',
241-
iconClass: 'test',
242-
selectMessage: 'Select Test2',
243-
validateParams: (): Promise<GenericValidationResult<unknown>> => {
244-
const validationResult = { errors: {} };
245-
return Promise.resolve(validationResult);
246-
},
247-
actionConnectorFields: null,
248-
});
249-
250-
beforeEach(() => {
251-
jest.clearAllMocks();
252-
});
253-
254-
it('Filters connectors based on name search', async () => {
255-
loadActionTypes.mockResolvedValue([
256-
{
257-
id: actionType1.id,
258-
enabled: true,
259-
name: 'Jira',
260-
enabledInConfig: true,
261-
enabledInLicense: true,
262-
minimumLicenseRequired: 'basic',
263-
supportedFeatureIds: ['alerting'],
264-
},
265-
{
266-
id: actionType2.id,
267-
enabled: true,
268-
name: 'Webhook',
269-
enabledInConfig: true,
270-
enabledInLicense: true,
271-
minimumLicenseRequired: 'basic',
272-
supportedFeatureIds: ['cases'],
273-
},
274-
]);
275-
276-
actionTypeRegistry.get.mockImplementation((id) =>
277-
id === actionType1.id ? actionType1 : actionType2
278-
);
279-
280-
appMockRenderer.render(
281-
<ActionTypeMenu
282-
onActionTypeChange={onActionTypeChange}
283-
actionTypeRegistry={actionTypeRegistry}
284-
searchValue="Jira"
285-
/>
286-
);
287-
288-
expect(await screen.findByTestId('action-type-1-card')).toBeInTheDocument();
289-
expect(screen.queryByTestId('action-type-2-card')).not.toBeInTheDocument();
290-
});
291-
292-
it('Filters connectors based on selectMessage search', async () => {
293-
loadActionTypes.mockResolvedValue([
294-
{
295-
id: actionType1.id,
296-
enabled: true,
297-
name: 'Jira',
298-
enabledInConfig: true,
299-
enabledInLicense: true,
300-
minimumLicenseRequired: 'basic',
301-
supportedFeatureIds: ['alerting'],
302-
},
303-
{
304-
id: actionType2.id,
305-
enabled: true,
306-
name: 'Webhook',
307-
enabledInConfig: true,
308-
enabledInLicense: true,
309-
minimumLicenseRequired: 'basic',
310-
supportedFeatureIds: ['cases'],
311-
},
312-
]);
313-
314-
actionTypeRegistry.get.mockImplementation((id) =>
315-
id === actionType1.id ? actionType1 : actionType2
316-
);
317-
318-
appMockRenderer.render(
319-
<ActionTypeMenu
320-
onActionTypeChange={onActionTypeChange}
321-
actionTypeRegistry={actionTypeRegistry}
322-
searchValue="Select Test2"
323-
/>
324-
);
325-
326-
expect(await screen.findByTestId('action-type-2-card')).toBeInTheDocument();
327-
expect(screen.queryByTestId('action-type-1-card')).not.toBeInTheDocument();
328-
});
329-
});
330-
331225
describe('beta badge', () => {
332226
it(`does not render beta badge when isExperimental=undefined`, async () => {
333227
const onActionTypeChange = jest.fn();

x-pack/platform/plugins/shared/triggers_actions_ui/public/application/sections/action_connector_form/create_connector_flyout/index.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ describe('CreateConnectorFlyout', () => {
137137
onConnectorCreated={onConnectorCreated}
138138
/>
139139
);
140-
await act(() => Promise.resolve());
141140

142141
expect(screen.queryByTestId('create-connector-flyout-save-test-btn')).not.toBeInTheDocument();
143142
});

0 commit comments

Comments
 (0)