From a37ff22ae9e6a981a24e61aebf7f6c7ddefee252 Mon Sep 17 00:00:00 2001 From: Zacqary Adam Xeper Date: Thu, 27 Jan 2022 15:08:45 -0600 Subject: [PATCH] Reenable alert_add test suite (#123862) * Reenable alert_add test suite * Remove delays Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../sections/alert_form/alert_add.test.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx index d3a6e94c786a4..3187021518c9c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx @@ -47,11 +47,6 @@ const actionTypeRegistry = actionTypeRegistryMock.create(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); const useKibanaMock = useKibana as jest.Mocked; -const delay = (wait: number = 1000) => - new Promise((resolve) => { - setTimeout(resolve, wait); - }); - export const TestExpression: FunctionComponent = () => { return ( @@ -64,8 +59,7 @@ export const TestExpression: FunctionComponent = () => { ); }; -// FLAKY: https://github.com/elastic/kibana/issues/g -describe.skip('alert_add', () => { +describe('alert_add', () => { let wrapper: ReactWrapper; async function setup( @@ -179,7 +173,6 @@ describe.skip('alert_add', () => { it('renders alert add flyout', async () => { const onClose = jest.fn(); await setup({}, onClose); - await delay(1000); expect(wrapper.find('[data-test-subj="addAlertFlyoutTitle"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="saveAlertButton"]').exists()).toBeTruthy(); @@ -209,8 +202,6 @@ describe.skip('alert_add', () => { onClose ); - await delay(1000); - expect(wrapper.find('input#alertName').props().value).toBe('Simple status alert'); expect(wrapper.find('[data-test-subj="tagsComboBox"]').first().text()).toBe('uptimelogs'); @@ -249,7 +240,6 @@ describe.skip('alert_add', () => { it('should enforce any default inteval', async () => { await setup({ alertTypeId: 'my-alert-type' }, jest.fn(), '3h'); - await delay(1000); // Wait for handlers to fire await act(async () => {