Skip to content

Commit

Permalink
Reenable alert_add test suite (elastic#123862)
Browse files Browse the repository at this point in the history
* Reenable alert_add test suite

* Remove delays

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and awahab07 committed Jan 31, 2022
1 parent 2e1172a commit a37ff22
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ const actionTypeRegistry = actionTypeRegistryMock.create();
const ruleTypeRegistry = ruleTypeRegistryMock.create();
const useKibanaMock = useKibana as jest.Mocked<typeof useKibana>;

const delay = (wait: number = 1000) =>
new Promise((resolve) => {
setTimeout(resolve, wait);
});

export const TestExpression: FunctionComponent<any> = () => {
return (
<EuiFormLabel>
Expand All @@ -64,8 +59,7 @@ export const TestExpression: FunctionComponent<any> = () => {
);
};

// FLAKY: https://github.com/elastic/kibana/issues/g
describe.skip('alert_add', () => {
describe('alert_add', () => {
let wrapper: ReactWrapper<any>;

async function setup(
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit a37ff22

Please sign in to comment.