-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cases] Test case_view_activity.test.tsx
suite
#160639
Conversation
1ec0e14
to
a7a19c1
Compare
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
@elasticmachine merge upstream |
const result = appMockRender.render(<CaseViewActivity {...caseProps} />); | ||
expect(result.queryByTestId('case-view-edit-connector')).toBeNull(); | ||
appMockRender.render(<CaseViewActivity {...caseProps} />); | ||
expect(screen.queryByTestId('case-view-edit-connector')).toBeNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: to be consistent, maybe
expect(screen.queryByTestId('case-view-edit-connector')).toBeNull(); | |
expect(screen.queryByTestId('case-view-edit-connector')).not.toBeInTheDocument(); |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will change it.
expect(await screen.findByTestId('case-tags')).toBeInTheDocument(); | ||
expect(await screen.findByTestId('cases-categories')).toBeInTheDocument(); | ||
expect(await screen.findByTestId('connector-edit-header')).toBeInTheDocument(); | ||
expect(await screen.findByTestId('case-view-status-action-button')).toBeInTheDocument(); | ||
|
||
await waitForComponentToUpdate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in many others we have this at the end of the test, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly we had it to add to remove some warnings regarding the state getting updated after the end of the test. You can read more about it here https://kentcdodds.com/blog/fix-the-not-wrapped-in-act-warning
@@ -162,19 +168,21 @@ describe('Case View Page activity tab', () => { | |||
beforeEach(() => { | |||
jest.clearAllMocks(); | |||
appMockRender = createAppMockRenderer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related but since we are here, this looks irrelevant no? Every test seems to re-initialize the appMockRenderer
anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I would like to keep it in the case in the future we add a test and do not re-initialize the appMockRenderer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM all changes are reasonable but reviewing I can't really tell if this fixes the flaky test definitely 😄
😄 The process I follow is the following:
The |
Sounds good! I was just wondering if this time there was something else that might have escaped me 👍 |
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @cnasikas |
## Summary Fixes flaky tests in `x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx` Successful runs: - elastic@a7a19c1 (40 times) - elastic@f5e0645 (45 times) - elastic@d9838cc (40 times) Fixes: elastic#151981, elastic#151979, elastic#151980, elastic#152209, elastic#152207, elastic#152208, elastic#152203, elastic#152203, elastic#152201, elastic#152206, elastic#152202, elastic#152204, elastic#152200 ### 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) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 6349724)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…0930) # Backport This will backport the following commits from `main` to `8.9`: - [[Cases] Test `case_view_activity.test.tsx` suite (#160639)](#160639) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Christos Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2023-06-29T16:33:20Z","message":"[Cases] Test `case_view_activity.test.tsx` suite (#160639)\n\n## Summary\r\n\r\nFixes flaky tests in\r\n`x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx`\r\n\r\nSuccessful runs:\r\n\r\n-\r\nhttps://github.com//pull/160639/commits/a7a19c1a74df5ca9202dcb1516b9284d3faf2b2a\r\n(40 times)\r\n-\r\nhttps://github.com//pull/160639/commits/f5e0645ebd3f8bbfedab52bea02669d3e1fe9b06\r\n(45 times)\r\n-\r\nhttps://github.com//pull/160639/commits/d9838cc71ba130612b3e6610df453987d39bfe42\r\n(40 times)\r\n\r\nFixes: https://github.com/elastic/kibana/issues/151981,\r\nhttps://github.com/elastic/kibana/issues/151979,\r\nhttps://github.com/elastic/kibana/issues/151980,\r\nhttps://github.com/elastic/kibana/issues/152209,\r\nhttps://github.com/elastic/kibana/issues/152207,\r\nhttps://github.com/elastic/kibana/issues/152208,\r\nhttps://github.com/elastic/kibana/issues/152203,\r\nhttps://github.com/elastic/kibana/issues/152203,\r\nhttps://github.com/elastic/kibana/issues/152201,\r\nhttps://github.com/elastic/kibana/issues/152206,\r\nhttps://github.com/elastic/kibana/issues/152202,https://github.com/elastic/kibana/issues/152205,\r\nhttps://github.com/elastic/kibana/issues/152204,\r\nhttps://github.com/elastic/kibana/issues/152200\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)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"6349724ff26d23fe927d8cb69fef642d76b396df","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":160639,"url":"https://github.com/elastic/kibana/pull/160639","mergeCommit":{"message":"[Cases] Test `case_view_activity.test.tsx` suite (#160639)\n\n## Summary\r\n\r\nFixes flaky tests in\r\n`x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx`\r\n\r\nSuccessful runs:\r\n\r\n-\r\nhttps://github.com//pull/160639/commits/a7a19c1a74df5ca9202dcb1516b9284d3faf2b2a\r\n(40 times)\r\n-\r\nhttps://github.com//pull/160639/commits/f5e0645ebd3f8bbfedab52bea02669d3e1fe9b06\r\n(45 times)\r\n-\r\nhttps://github.com//pull/160639/commits/d9838cc71ba130612b3e6610df453987d39bfe42\r\n(40 times)\r\n\r\nFixes: https://github.com/elastic/kibana/issues/151981,\r\nhttps://github.com/elastic/kibana/issues/151979,\r\nhttps://github.com/elastic/kibana/issues/151980,\r\nhttps://github.com/elastic/kibana/issues/152209,\r\nhttps://github.com/elastic/kibana/issues/152207,\r\nhttps://github.com/elastic/kibana/issues/152208,\r\nhttps://github.com/elastic/kibana/issues/152203,\r\nhttps://github.com/elastic/kibana/issues/152203,\r\nhttps://github.com/elastic/kibana/issues/152201,\r\nhttps://github.com/elastic/kibana/issues/152206,\r\nhttps://github.com/elastic/kibana/issues/152202,https://github.com/elastic/kibana/issues/152205,\r\nhttps://github.com/elastic/kibana/issues/152204,\r\nhttps://github.com/elastic/kibana/issues/152200\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)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"6349724ff26d23fe927d8cb69fef642d76b396df"}},"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/160639","number":160639,"mergeCommit":{"message":"[Cases] Test `case_view_activity.test.tsx` suite (#160639)\n\n## Summary\r\n\r\nFixes flaky tests in\r\n`x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx`\r\n\r\nSuccessful runs:\r\n\r\n-\r\nhttps://github.com//pull/160639/commits/a7a19c1a74df5ca9202dcb1516b9284d3faf2b2a\r\n(40 times)\r\n-\r\nhttps://github.com//pull/160639/commits/f5e0645ebd3f8bbfedab52bea02669d3e1fe9b06\r\n(45 times)\r\n-\r\nhttps://github.com//pull/160639/commits/d9838cc71ba130612b3e6610df453987d39bfe42\r\n(40 times)\r\n\r\nFixes: https://github.com/elastic/kibana/issues/151981,\r\nhttps://github.com/elastic/kibana/issues/151979,\r\nhttps://github.com/elastic/kibana/issues/151980,\r\nhttps://github.com/elastic/kibana/issues/152209,\r\nhttps://github.com/elastic/kibana/issues/152207,\r\nhttps://github.com/elastic/kibana/issues/152208,\r\nhttps://github.com/elastic/kibana/issues/152203,\r\nhttps://github.com/elastic/kibana/issues/152203,\r\nhttps://github.com/elastic/kibana/issues/152201,\r\nhttps://github.com/elastic/kibana/issues/152206,\r\nhttps://github.com/elastic/kibana/issues/152202,https://github.com/elastic/kibana/issues/152205,\r\nhttps://github.com/elastic/kibana/issues/152204,\r\nhttps://github.com/elastic/kibana/issues/152200\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)\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"6349724ff26d23fe927d8cb69fef642d76b396df"}}]}] BACKPORT--> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Summary
Fixes flaky tests in
x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx
Successful runs:
Fixes: #151981, #151979, #151980, #152209, #152207, #152208, #152203, #152203, #152201, #152206, #152202, #152204, #152200
Checklist
Delete any items that are not applicable to this PR.
For maintainers