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

[SecuritySolution][Endpoint] Re-enabled skipped tests #197220

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']);
});
});