Skip to content

Commit

Permalink
[Cases] Fix case view flaky tests (elastic#160412)
Browse files Browse the repository at this point in the history
## Summary

This PR fixes flaky tests in
`x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx`.
Some of them were converted to an e2e test as they were too slow to be
on a unit test.

Successful runs:

-
elastic@a4ed839
(50 times)
-
elastic@82ccceb
(45 times)
-
elastic@43c47e6
(20 times)

Fixes: elastic#149775,
elastic#149776,
elastic#149777,
elastic#149778,
elastic#149779,
elastic#149780,
elastic#149781,
elastic#149782,
elastic#153335,
elastic#153336,
elastic#149773,
elastic#149774,
elastic#149772,
elastic#149771,
elastic#149770,
elastic#149769,
elastic#151845,
elastic#153336,
elastic#153335

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2500

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit c0047a1)
  • Loading branch information
cnasikas committed Jun 27, 2023
1 parent 29d32cc commit e9e3403
Show file tree
Hide file tree
Showing 7 changed files with 418 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface StartServiceArgs {

export const createStartServicesMock = ({ license }: StartServiceArgs = {}): StartServices => {
const licensingPluginMock = licensingMock.createStart();
const triggersActionsUi = triggersActionsUiMock.createStart();

const services = {
...coreMock.createStart(),
Expand All @@ -39,7 +40,11 @@ export const createStartServicesMock = ({ license }: StartServiceArgs = {}): Sta
navigateToPrefilledEditor: jest.fn(),
},
security: securityMock.createStart(),
triggersActionsUi: triggersActionsUiMock.createStart(),
triggersActionsUi: {
actionTypeRegistry: triggersActionsUi.actionTypeRegistry,
alertsTableConfigurationRegistry: triggersActionsUi.alertsTableConfigurationRegistry,
getAlertsStateTable: jest.fn().mockReturnValue(<div data-test-subj="alerts-table" />),
},
spaces: spacesPluginMock.createStartContract(),
licensing:
license != null
Expand Down
Loading

0 comments on commit e9e3403

Please sign in to comment.