Skip to content

Commit

Permalink
[Cases] fix description user actions flaky test (elastic#170324)
Browse files Browse the repository at this point in the history
## Summary

I removed the description user actions tests from
`x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx`

There were a few things being tested:

| Old Test  | Where is it covered |
| ------------- | ------------- |
| should render the description correctly | added description
integration on case view activity page `should render the activity
content and main components` , text of the description is already
verified in
`x-pack/plugins/cases/public/components/user_actions/description.test.tsx`
|
| renders edit description user action correctly | Already testing
description create and update user actions in `renders user actions
correctly` in file
`x-pack/plugins/cases/public/components/user_actions/user_actions_list.test.tsx`
|

Fixes elastic#151981

### 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 1d337e3)
  • Loading branch information
js-jankisalvi committed Nov 2, 2023
1 parent 4189cac commit 64d97b2
Showing 1 changed file with 2 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ describe('Case View Page activity tab', () => {

expect(await screen.findByTestId('case-view-activity')).toBeInTheDocument();
expect(await screen.findAllByTestId('user-actions-list')).toHaveLength(2);
expect(await screen.findByTestId('description')).toBeInTheDocument();
expect(await screen.findByTestId('case-tags')).toBeInTheDocument();
expect(await screen.findByTestId('cases-categories')).toBeInTheDocument();
expect(await screen.findByTestId('connector-edit-header')).toBeInTheDocument();
Expand Down Expand Up @@ -417,38 +418,7 @@ describe('Case View Page activity tab', () => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/151981
describe.skip('User actions', () => {
it('renders the description correctly', async () => {
appMockRender = createAppMockRenderer();
appMockRender.render(<CaseViewActivity {...caseProps} />);

const description = within(await screen.findByTestId('description'));

expect(await description.findByText(caseData.description)).toBeInTheDocument();
});

it('renders edit description user action correctly', async () => {
useFindCaseUserActionsMock.mockReturnValue({
...defaultUseFindCaseUserActions,
data: {
userActions: [
getUserAction('description', 'create'),
getUserAction('description', 'update'),
],
},
});

appMockRender = createAppMockRenderer();
appMockRender.render(<CaseViewActivity {...caseProps} />);

const userActions = within((await screen.findAllByTestId('user-actions-list'))[1]);

expect(
userActions.getByTestId('description-update-action-description-update')
).toBeInTheDocument();
});

describe('User actions', () => {
it('renders the unassigned users correctly', async () => {
useFindCaseUserActionsMock.mockReturnValue({
...defaultUseFindCaseUserActions,
Expand Down

0 comments on commit 64d97b2

Please sign in to comment.