Skip to content
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 failed jest tests for all_cases_list #149005

Merged
merged 14 commits into from
Feb 10, 2023

Conversation

js-jankisalvi
Copy link
Contributor

@js-jankisalvi js-jankisalvi commented Jan 17, 2023

Summary

This PR fixes failed jest tests for all_cases_list component.
Fixes: #139676, #142763, #148094, #148095, #148096, #148485, #148486, #148487, #148488, #148490, #148491, #148492, #148493, #148343

@js-jankisalvi js-jankisalvi self-assigned this Jan 17, 2023
@js-jankisalvi js-jankisalvi added the Feature:Cases Cases feature label Jan 17, 2023
@js-jankisalvi js-jankisalvi added release_note:skip Skip the PR/issue when compiling release notes v8.7.0 backport:skip This commit does not require backporting labels Jan 17, 2023
@cnasikas cnasikas added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Jan 17, 2023
<AllCasesList />
</TestProviders>
);
expect(wrapper.find('[data-test-subj="cases-count-stats"]')).toBeTruthy();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-test-subj="cases-count-stats" doesn't exist anywhere in all_cases_list and it's child components.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// Flaky: https://github.com/elastic/kibana/issues/148490
describe.skip('Assignees', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block was outside of main describe block which caused timeout to get mock data of useGetCases

);
expect(
screen.getAllByTestId('case-table-column-createdAt')[0].querySelector('.euiToolTipAnchor')
).toHaveTextContent(removeMsFromDate(useGetCasesMockState.data.cases[0].createdAt));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are removing milliseconds in CreatedAt column in use_cases_columns hook, while mock data is with milliseconds.

@js-jankisalvi js-jankisalvi marked this pull request as ready for review February 9, 2023 14:47
@js-jankisalvi js-jankisalvi requested a review from a team as a code owner February 9, 2023 14:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@js-jankisalvi js-jankisalvi requested a review from a team February 9, 2023 14:47
@js-jankisalvi js-jankisalvi changed the title Jest failed test [Cases] Fix failed jest tests for all_cases_list Feb 9, 2023
Copy link
Contributor

@jonathan-buttner jonathan-buttner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactoring!

Just left one comment about removing a line 👍

<AllCasesList />
</TestProviders>
);
expect(wrapper.find('[data-test-subj="cases-count-stats"]')).toBeTruthy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1020,37 +943,35 @@ describe.skip('AllCasesListGeneric', () => {
});
});

it.each(severityTests)('update the status of a case: %s', async (severity) => {
const res = appMockRenderer.render(<AllCasesList />);
it.each(severityTests)('update the severity of a case: %s', async (severity) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙇

it('should hide the assignees column on basic license', async () => {
useLicenseMock.mockReturnValue({ isAtLeastPlatinum: () => false });
// Flaky: https://github.com/elastic/kibana/issues/148490
describe('Assignees', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the comment above this

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @js-jankisalvi

@js-jankisalvi js-jankisalvi merged commit adb8a92 into elastic:main Feb 10, 2023
This was referenced Feb 10, 2023
@js-jankisalvi js-jankisalvi deleted the jest-failed-test branch October 6, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing test: Jest Tests.x-pack/plugins/cases/public/components/all_cases - AllCases should render the stats
6 participants