-
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] Fix flaky tests in the CaseViewPage
component
#172940
Conversation
describe('description', () => { | ||
it('renders the description correctly', async () => { | ||
appMockRenderer.render(<CaseViewPage {...caseProps} />); | ||
describe('description', () => { |
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.
Moved outside the Tabs
block.
} | ||
return CASE_VIEW_PAGE_TABS.ACTIVITY; | ||
}, [urlParams.tabId]); | ||
const activeTabId = getActiveTabId(urlParams?.tabId); |
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.
When I removed some tests the other tests started failing. There was an issue with mocking and memorization that affected the tests. I removed the useMemo
as it is redundant.
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
it('renders tabs correctly', async () => { | ||
await testSubjects.existOrFail('case-view-tab-title-activity'); | ||
await testSubjects.existOrFail('case-view-tab-title-files'); | ||
// there are no alerts in stack management yet |
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.
When this PR #172217 is merged we can test the alerts table in the stack.
buildkite test this |
@@ -191,273 +200,218 @@ describe('CaseViewPage', () => { | |||
Object.defineProperty(window, 'getComputedStyle', originalGetComputedStyle); | |||
}); | |||
|
|||
it('shows the metrics section', async () => { | |||
appMockRenderer.render(<CaseViewPage {...caseProps} />); | |||
for (let index = 0; index < 50; index++) { |
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.
Don't forget to remove this
it('shows the "activity" tab by default', async () => { | ||
await testSubjects.existOrFail('case-view-tab-title-activity'); | ||
await testSubjects.existOrFail('case-view-tab-content-activity'); | ||
}); | ||
|
||
it("shows the 'activity' tab when clicked", async () => { |
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.
Does this test make sense here following the previous one?
We are already in the activity tab, I don't know how relevant it is to check that nothing changes when we click it.
Maybe we could go to files and back instead?
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.
Good idea. Much better.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
/ci |
1 similar comment
/ci |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
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
Tests:
renders tabs correctly
: Moved to functional testingrenders the activity tab by default
: Removed. It is being tested in functional testingrenders the activity tab when the query parameter tabId has activity
: Moved to functional testingrenders the activity tab when the query parameter tabId has an unknown value
: Moved to functional testingnavigates to the activity tab when the activity tab is clicked
: Moved to functional testingshould show closed indicators in header when case is closed
: Moved tox-pack/plugins/cases/public/components/case_action_bar/index.test.tsx
should push updates on button click
: Moved tox-pack/plugins/cases/public/components/edit_connector/index.test.tsx
should disable the push button when connector is invalid
: Moved tox-pack/plugins/cases/public/components/edit_connector/index.test.tsx
should show the rule name
: Already tested inx-pack/plugins/cases/public/components/user_actions/comment/alert_event.test.tsx
should show the correct connector name on the push button
: Moved tox-pack/plugins/cases/public/components/edit_connector/index.test.tsx
Callouts
: Already tested inx-pack/plugins/cases/public/components/use_push_to_service/index.test.tsx
should display the alerts tab when the feature is enabled
: Moved tox-pack/plugins/cases/public/components/case_view/case_view_tabs.test.tsx
should not display the alerts tab when the feature is disabled
: Moved tox-pack/plugins/cases/public/components/case_view/case_view_tabs.test.tsx
should not show the experimental badge on the alerts table
: Moved tox-pack/plugins/cases/public/components/case_view/case_view_tabs.test.tsx
should show the experimental badge on the alerts table
: Moved tox-pack/plugins/cases/public/components/case_view/case_view_tabs.test.tsx
renders the alerts tab when the query parameter tabId has alerts
: Unskip functional testnavigates to the alerts tab when the alerts tab is clicked
: Removed. It is being tested in functional testingshows the connectors in the sidebar
: Removed. It is being tested in functional testingshows the case action bar
: Removed. It is being tested in functional testingshould show loading content when loading user actions stats
: Removed. Already tested inx-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx
should call show alert details with expected arguments
: Removed. Already tested inx-pack/plugins/cases/public/components/user_actions/comment/comment.test.tsx
should show the case tabs
: Moved to functional testingshould display description when case is loading
: Moved tox-pack/plugins/cases/public/components/description/index.test.tsx
renders the description correctly
: Removed. Already tested inx-pack/plugins/cases/public/components/description/index.test.tsx
should update settings
: Removed. Already tested inx-pack/plugins/cases/public/components/case_action_bar/index.test.tsx
Fixes: #149778, #149777, #149776, #170532, #171718, #149771, #173136
Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4862
Successful builds: https://buildkite.com/elastic/kibana-pull-request/builds?branch=cnasikas%3Afix_149777
Checklist
Delete any items that are not applicable to this PR.
For maintainers