Skip to content

Commit

Permalink
[Cases] Unhandled promises in tests (elastic#166142)
Browse files Browse the repository at this point in the history
Fixes elastic#166123
Fixes elastic#166027
Fixes elastic#166127

## Summary

This PR fixes the unhandled promises mentioned in
elastic#166127 (comment)

I unskipped the potentially affected tests [and the flaky test runner is
running](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3078).

If the tests pass and these changes have fixed them, I will unskip the
serverless version of the tests too.
  • Loading branch information
adcoelho authored Sep 11, 2023
1 parent cffe322 commit 04df613
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});

it('initially renders user actions list correctly', async () => {
expect(testSubjects.missingOrFail('cases-show-more-user-actions'));
await testSubjects.missingOrFail('cases-show-more-user-actions');

const userActionsLists = await find.allByCssSelector(
'[data-test-subj="user-actions-list"]'
Expand All @@ -821,15 +821,15 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
totalUpdates: 4,
});

expect(testSubjects.missingOrFail('user-actions-loading'));
await testSubjects.missingOrFail('user-actions-loading');

await header.waitUntilLoadingHasFinished();

await testSubjects.click('case-refresh');

await header.waitUntilLoadingHasFinished();

expect(testSubjects.existOrFail('cases-show-more-user-actions'));
await testSubjects.existOrFail('cases-show-more-user-actions');

const userActionsLists = await find.allByCssSelector(
'[data-test-subj="user-actions-list"]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166027
describe.skip('status', () => {
describe('status', () => {
before(async () => {
await cases.api.createNthRandomCases(2);
await header.waitUntilLoadingHasFinished();
Expand All @@ -96,8 +95,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166123
describe.skip('severity', () => {
describe('severity', () => {
before(async () => {
await cases.api.createNthRandomCases(2);
await header.waitUntilLoadingHasFinished();
Expand Down Expand Up @@ -503,8 +501,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166127
describe.skip('severity filtering', () => {
describe('severity filtering', () => {
before(async () => {
await cases.navigation.navigateToApp();
await cases.api.createCase({ severity: CaseSeverity.LOW });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166027
describe.skip('status', () => {
describe('status', () => {
createNCasesBeforeDeleteAllAfter(2, getPageObject, getService);

it('change the status of cases to in-progress correctly', async () => {
Expand All @@ -64,8 +63,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166123
describe.skip('severity', () => {
describe('severity', () => {
createNCasesBeforeDeleteAllAfter(2, getPageObject, getService);

it('change the severity of cases to medium correctly', async () => {
Expand Down Expand Up @@ -145,8 +143,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166127
describe.skip('severity filtering', () => {
describe('severity filtering', () => {
before(async () => {
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observability-overview:cases' });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});

it('initially renders user actions list correctly', async () => {
expect(testSubjects.missingOrFail('cases-show-more-user-actions'));
await testSubjects.missingOrFail('cases-show-more-user-actions');

const userActionsLists = await find.allByCssSelector(
'[data-test-subj="user-actions-list"]'
Expand All @@ -329,15 +329,15 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
totalUpdates: 4,
});

expect(testSubjects.missingOrFail('user-actions-loading'));
await testSubjects.missingOrFail('user-actions-loading');

await header.waitUntilLoadingHasFinished();

await testSubjects.click('case-refresh');

await header.waitUntilLoadingHasFinished();

expect(testSubjects.existOrFail('cases-show-more-user-actions'));
await testSubjects.existOrFail('cases-show-more-user-actions');

const userActionsLists = await find.allByCssSelector(
'[data-test-subj="user-actions-list"]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166027
describe.skip('status', () => {
describe('status', () => {
createNCasesBeforeDeleteAllAfter(2, getPageObject, getService);

it('change the status of cases to in-progress correctly', async () => {
Expand All @@ -64,8 +63,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166123
describe.skip('severity', () => {
describe('severity', () => {
createNCasesBeforeDeleteAllAfter(2, getPageObject, getService);

it('change the severity of cases to medium correctly', async () => {
Expand Down Expand Up @@ -145,8 +143,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/166127
describe.skip('severity filtering', () => {
describe('severity filtering', () => {
before(async () => {
await testSubjects.click('solutionSideNavItemLink-cases');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});

it('initially renders user actions list correctly', async () => {
expect(testSubjects.missingOrFail('cases-show-more-user-actions'));
await testSubjects.missingOrFail('cases-show-more-user-actions');

const userActionsLists = await find.allByCssSelector(
'[data-test-subj="user-actions-list"]'
Expand All @@ -328,15 +328,15 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
totalUpdates: 4,
});

expect(testSubjects.missingOrFail('user-actions-loading'));
await testSubjects.missingOrFail('user-actions-loading');

await header.waitUntilLoadingHasFinished();

await testSubjects.click('case-refresh');

await header.waitUntilLoadingHasFinished();

expect(testSubjects.existOrFail('cases-show-more-user-actions'));
await testSubjects.existOrFail('cases-show-more-user-actions');

const userActionsLists = await find.allByCssSelector(
'[data-test-subj="user-actions-list"]'
Expand Down

0 comments on commit 04df613

Please sign in to comment.