Skip to content

Commit

Permalink
Update trusted_apps_list.test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ashokaditya committed Apr 21, 2022
1 parent 06f0330 commit 83c4e1c
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ import { exceptionsListAllHttpMocks } from '../../mocks/exceptions_list_http_moc
import { SEARCHABLE_FIELDS } from '../constants';
import { parseQueryFilterToKQL } from '../../../common/utils';
import { useUserPrivileges as _useUserPrivileges } from '../../../../common/components/user_privileges';
import { getUserPrivilegesMockDefaultValue } from '../../../../common/components/user_privileges/__mocks__';
import { getFirstCard } from '../../../components/artifact_list_page/mocks';

jest.mock('../../../../common/components/user_privileges');
const useUserPrivilegesMock = _useUserPrivileges as jest.Mock;

describe('When on the trusted applications page', () => {
let render: () => ReturnType<AppContextTestRender['render']>;
Expand All @@ -40,14 +37,9 @@ describe('When on the trusted applications page', () => {
});
});

afterEach(() => {
useUserPrivilegesMock.mockImplementation(getUserPrivilegesMockDefaultValue);
});

it('should search using expected exception item fields', async () => {
const expectedFilterString = parseQueryFilterToKQL('fooFooFoo', SEARCHABLE_FIELDS);
const { findAllByTestId } = render();
console.log('expectedFilterString ', expectedFilterString);
await waitFor(async () => {
await expect(findAllByTestId('trustedAppsListPage-card')).resolves.toHaveLength(10);
});
Expand Down

0 comments on commit 83c4e1c

Please sign in to comment.