Skip to content

Commit

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

This will backport the following commits from `main` to `8.9`:
- [[Cases] Fix case view flaky tests
(#160412)](#160412)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-27T13:57:30Z","message":"[Cases]
Fix case view flaky tests (#160412)\n\n## Summary\r\n\r\nThis PR fixes
flaky tests
in\r\n`x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx`.\r\nSome
of them were converted to an e2e test as they were too slow to be\r\non
a unit test.\r\n\r\nSuccessful runs:
\r\n\r\n-\r\nhttps://github.com//pull/160412/commits/a4ed8390d45b628ee4328c3655164c94449e3dc8\r\n(50
times)\r\n-\r\nhttps://github.com//pull/160412/commits/82ccceb03aff6f74cd30f80fcaaa0f2b99c28103\r\n(45
times)\r\n-\r\nhttps://github.com//pull/160412/commits/43c47e645b26561c00de97e8a4d965b435a5491b\r\n(20
times)\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/149775,\r\nhttps://github.com/elastic/kibana/issues/149776,\r\nhttps://github.com/elastic/kibana/issues/149777,\r\nhttps://github.com/elastic/kibana/issues/149778,\r\nhttps://github.com/elastic/kibana/issues/149779,\r\nhttps://github.com/elastic/kibana/issues/149780,\r\nhttps://github.com/elastic/kibana/issues/149781,\r\nhttps://github.com/elastic/kibana/issues/149782,\r\nhttps://github.com/elastic/kibana/issues/153335,\r\nhttps://github.com/elastic/kibana/issues/153336,\r\nhttps://github.com/elastic/kibana/issues/149773,\r\nhttps://github.com/elastic/kibana/issues/149774,\r\nhttps://github.com/elastic/kibana/issues/149772,\r\nhttps://github.com/elastic/kibana/issues/149771,\r\nhttps://github.com/elastic/kibana/issues/149770,\r\nhttps://github.com/elastic/kibana/issues/149769,\r\nhttps://github.com/elastic/kibana/issues/151845,\r\nhttps://github.com/elastic/kibana/issues/153336,\r\nhttps://github.com/elastic/kibana/issues/153335\r\n\r\nFlaky
test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2500\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"c0047a1b94d898a16e4a5aad94663f07b5b06e52","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Feature:Cases","v8.9.0","v8.10.0"],"number":160412,"url":"https://github.com/elastic/kibana/pull/160412","mergeCommit":{"message":"[Cases]
Fix case view flaky tests (#160412)\n\n## Summary\r\n\r\nThis PR fixes
flaky tests
in\r\n`x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx`.\r\nSome
of them were converted to an e2e test as they were too slow to be\r\non
a unit test.\r\n\r\nSuccessful runs:
\r\n\r\n-\r\nhttps://github.com//pull/160412/commits/a4ed8390d45b628ee4328c3655164c94449e3dc8\r\n(50
times)\r\n-\r\nhttps://github.com//pull/160412/commits/82ccceb03aff6f74cd30f80fcaaa0f2b99c28103\r\n(45
times)\r\n-\r\nhttps://github.com//pull/160412/commits/43c47e645b26561c00de97e8a4d965b435a5491b\r\n(20
times)\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/149775,\r\nhttps://github.com/elastic/kibana/issues/149776,\r\nhttps://github.com/elastic/kibana/issues/149777,\r\nhttps://github.com/elastic/kibana/issues/149778,\r\nhttps://github.com/elastic/kibana/issues/149779,\r\nhttps://github.com/elastic/kibana/issues/149780,\r\nhttps://github.com/elastic/kibana/issues/149781,\r\nhttps://github.com/elastic/kibana/issues/149782,\r\nhttps://github.com/elastic/kibana/issues/153335,\r\nhttps://github.com/elastic/kibana/issues/153336,\r\nhttps://github.com/elastic/kibana/issues/149773,\r\nhttps://github.com/elastic/kibana/issues/149774,\r\nhttps://github.com/elastic/kibana/issues/149772,\r\nhttps://github.com/elastic/kibana/issues/149771,\r\nhttps://github.com/elastic/kibana/issues/149770,\r\nhttps://github.com/elastic/kibana/issues/149769,\r\nhttps://github.com/elastic/kibana/issues/151845,\r\nhttps://github.com/elastic/kibana/issues/153336,\r\nhttps://github.com/elastic/kibana/issues/153335\r\n\r\nFlaky
test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2500\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"c0047a1b94d898a16e4a5aad94663f07b5b06e52"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160412","number":160412,"mergeCommit":{"message":"[Cases]
Fix case view flaky tests (#160412)\n\n## Summary\r\n\r\nThis PR fixes
flaky tests
in\r\n`x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx`.\r\nSome
of them were converted to an e2e test as they were too slow to be\r\non
a unit test.\r\n\r\nSuccessful runs:
\r\n\r\n-\r\nhttps://github.com//pull/160412/commits/a4ed8390d45b628ee4328c3655164c94449e3dc8\r\n(50
times)\r\n-\r\nhttps://github.com//pull/160412/commits/82ccceb03aff6f74cd30f80fcaaa0f2b99c28103\r\n(45
times)\r\n-\r\nhttps://github.com//pull/160412/commits/43c47e645b26561c00de97e8a4d965b435a5491b\r\n(20
times)\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/149775,\r\nhttps://github.com/elastic/kibana/issues/149776,\r\nhttps://github.com/elastic/kibana/issues/149777,\r\nhttps://github.com/elastic/kibana/issues/149778,\r\nhttps://github.com/elastic/kibana/issues/149779,\r\nhttps://github.com/elastic/kibana/issues/149780,\r\nhttps://github.com/elastic/kibana/issues/149781,\r\nhttps://github.com/elastic/kibana/issues/149782,\r\nhttps://github.com/elastic/kibana/issues/153335,\r\nhttps://github.com/elastic/kibana/issues/153336,\r\nhttps://github.com/elastic/kibana/issues/149773,\r\nhttps://github.com/elastic/kibana/issues/149774,\r\nhttps://github.com/elastic/kibana/issues/149772,\r\nhttps://github.com/elastic/kibana/issues/149771,\r\nhttps://github.com/elastic/kibana/issues/149770,\r\nhttps://github.com/elastic/kibana/issues/149769,\r\nhttps://github.com/elastic/kibana/issues/151845,\r\nhttps://github.com/elastic/kibana/issues/153336,\r\nhttps://github.com/elastic/kibana/issues/153335\r\n\r\nFlaky
test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2500\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"c0047a1b94d898a16e4a5aad94663f07b5b06e52"}}]}]
BACKPORT-->

Co-authored-by: Christos Nasikas <[email protected]>
  • Loading branch information
kibanamachine and cnasikas authored Jun 27, 2023
1 parent 9b77b6d commit 15664fb
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 15664fb

Please sign in to comment.