Skip to content

Commit

Permalink
[8.x] [SecuritySolution][Endpoint] Re-enabled skipped tests (#197220) (
Browse files Browse the repository at this point in the history
…#197380)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[SecuritySolution][Endpoint] Re-enabled skipped tests
(#197220)](#197220)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT
[{"author":{"name":"Ash","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-23T08:33:37Z","message":"[SecuritySolution][Endpoint]
Re-enabled skipped tests (#197220)\n\n## Summary\r\n\r\nThis PR attempts
to fix tests skipped in /issues/193092\r\nand
/issues/193554.\r\nThe tests seem to be flaky right after
an [upgrade
to\r\n`user-event`](#189949)
dependency\r\non Sep 10th.\r\n\r\n### Checklist\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- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"e70b533bdb443a4ebc8229237583160eeeaad412","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Defend
Workflows","backport:version","v8.17.0"],"title":"[SecuritySolution][Endpoint]
Re-enabled skipped
tests","number":197220,"url":"https://github.com/elastic/kibana/pull/197220","mergeCommit":{"message":"[SecuritySolution][Endpoint]
Re-enabled skipped tests (#197220)\n\n## Summary\r\n\r\nThis PR attempts
to fix tests skipped in /issues/193092\r\nand
/issues/193554.\r\nThe tests seem to be flaky right after
an [upgrade
to\r\n`user-event`](#189949)
dependency\r\non Sep 10th.\r\n\r\n### Checklist\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- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"e70b533bdb443a4ebc8229237583160eeeaad412"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197220","number":197220,"mergeCommit":{"message":"[SecuritySolution][Endpoint]
Re-enabled skipped tests (#197220)\n\n## Summary\r\n\r\nThis PR attempts
to fix tests skipped in /issues/193092\r\nand
/issues/193554.\r\nThe tests seem to be flaky right after
an [upgrade
to\r\n`user-event`](#189949)
dependency\r\non Sep 10th.\r\n\r\n### Checklist\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- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"e70b533bdb443a4ebc8229237583160eeeaad412"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ash <[email protected]>
  • Loading branch information
kibanamachine and ashokaditya authored Oct 23, 2024
1 parent e42a5d3 commit 7c3334f
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import {
import { ActionsLogUsersFilter } from './actions_log_users_filter';
import { MANAGEMENT_PATH } from '../../../../../common/constants';

// FLAKY: https://github.com/elastic/kibana/issues/193554
// FLAKY: https://github.com/elastic/kibana/issues/193092
describe.skip('Users filter', () => {
describe('Users filter', () => {
let render: (
props?: React.ComponentProps<typeof ActionsLogUsersFilter>
) => ReturnType<AppContextTestRender['render']>;
Expand All @@ -29,7 +27,7 @@ describe.skip('Users filter', () => {
const filterPrefix = 'users-filter';
let onChangeUsersFilter: jest.Mock;

beforeEach(async () => {
beforeEach(() => {
onChangeUsersFilter = jest.fn();
mockedContext = createAppRootMockRenderer();
({ history } = mockedContext);
Expand Down Expand Up @@ -58,35 +56,35 @@ describe.skip('Users filter', () => {
render();

const searchInput = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-search`);
await userEvent.type(searchInput, 'usernameX');
await userEvent.type(searchInput, '{enter}');
await userEvent.type(searchInput, 'usernameX', { delay: 10 });
await userEvent.keyboard('{enter}');
expect(onChangeUsersFilter).toHaveBeenCalledWith(['usernameX']);
});

it('should search comma separated strings as multiple users', async () => {
render();

const searchInput = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-search`);
await userEvent.type(searchInput, 'usernameX,usernameY,usernameZ');
await userEvent.type(searchInput, '{enter}');
await userEvent.type(searchInput, 'usernameX,usernameY,usernameZ', { delay: 10 });
await userEvent.keyboard('{enter}');
expect(onChangeUsersFilter).toHaveBeenCalledWith(['usernameX', 'usernameY', 'usernameZ']);
});

it('should ignore white spaces in a given username when updating the API params', async () => {
render();

const searchInput = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-search`);
await userEvent.type(searchInput, ' usernameX ');
await userEvent.type(searchInput, '{enter}');
await userEvent.type(searchInput, ' usernameX ', { delay: 10 });
await userEvent.keyboard('{enter}');
expect(onChangeUsersFilter).toHaveBeenCalledWith(['usernameX']);
});

it('should ignore white spaces in comma separated usernames when updating the API params', async () => {
render();

const searchInput = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-search`);
await userEvent.type(searchInput, ' , usernameX ,usernameY , ');
await userEvent.type(searchInput, '{enter}');
await userEvent.type(searchInput, ' , usernameX ,usernameY , ', { delay: 10 });
await userEvent.keyboard('{enter}');
expect(onChangeUsersFilter).toHaveBeenCalledWith(['usernameX', 'usernameY']);
});
});

0 comments on commit 7c3334f

Please sign in to comment.