import { shallow } from 'enzyme';
import React from 'react';
import Modal from '../../../components/controls/Modal';
-import { mockEvent } from '../../../helpers/testMocks';
+import { mockEvent } from '../../../helpers/testUtils';
import KeyboardShortcutsModal from '../KeyboardShortcutsModal';
jest.mock('react', () => {
import * as React from 'react';
import { createApplication } from '../../../../api/application';
import SimpleModal from '../../../../components/controls/SimpleModal';
-import { mockEvent } from '../../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../../helpers/testUtils';
+import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils';
import { ComponentQualifier, Visibility } from '../../../../types/component';
import CreateApplicationForm from '../CreateApplicationForm';
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import { mockEvent, mockQualityProfile } from '../../../../helpers/testMocks';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
+import { mockEvent } from '../../../../helpers/testUtils';
import BulkChange from '../BulkChange';
const profile = mockQualityProfile({
import * as React from 'react';
import { Link } from 'react-router';
import { deactivateRule } from '../../../../api/quality-profiles';
-import { mockEvent, mockQualityProfile, mockRule } from '../../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../../helpers/testUtils';
+import { mockQualityProfile, mockRule } from '../../../../helpers/testMocks';
+import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils';
import RuleListItem from '../RuleListItem';
jest.mock('../../../../api/quality-profiles', () => ({
import BoxedGroupAccordion from '../../../../components/controls/BoxedGroupAccordion';
import Radio from '../../../../components/controls/Radio';
import { mockAzureProject, mockAzureRepository } from '../../../../helpers/mocks/alm-integrations';
-import { mockEvent } from '../../../../helpers/testMocks';
+import { mockEvent } from '../../../../helpers/testUtils';
import AzureProjectAccordion, { AzureProjectAccordionProps } from '../AzureProjectAccordion';
it('should render correctly', () => {
import { SubmitButton } from '../../../../components/controls/buttons';
import ValidationInput from '../../../../components/controls/ValidationInput';
import { validateProjectKey } from '../../../../helpers/projects';
-import { mockEvent } from '../../../../helpers/testMocks';
-import { change, submit, waitAndUpdate } from '../../../../helpers/testUtils';
+import { change, mockEvent, submit, waitAndUpdate } from '../../../../helpers/testUtils';
import { ProjectKeyValidationResult } from '../../../../types/component';
import { PROJECT_NAME_MAX_LEN } from '../constants';
import ManualProjectCreate from '../ManualProjectCreate';
} from '../../../../helpers/pages';
import {
mockCurrentUser,
- mockEvent,
mockIssue,
mockLocation,
mockLoggedInUser,
mockRawIssue,
mockRouter
} from '../../../../helpers/testMocks';
-import { keydown, waitAndUpdate } from '../../../../helpers/testUtils';
+import { keydown, mockEvent, waitAndUpdate } from '../../../../helpers/testUtils';
import { ComponentQualifier } from '../../../../types/component';
import { ReferencedComponent } from '../../../../types/issues';
import { Issue, Paging } from '../../../../types/types';
} from '../../../../api/newCodePeriod';
import { mockBranch, mockMainBranch, mockPullRequest } from '../../../../helpers/mocks/branch-like';
import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockAppState, mockEvent } from '../../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../../helpers/testUtils';
+import { mockAppState } from '../../../../helpers/testMocks';
+import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils';
import { App } from '../App';
jest.mock('../../../../api/newCodePeriod', () => ({
import ProjectKeyInput from '../../../components/common/ProjectKeyInput';
import { Button, SubmitButton } from '../../../components/controls/buttons';
import { mockComponent } from '../../../helpers/mocks/component';
-import { mockEvent } from '../../../helpers/testMocks';
-import { click } from '../../../helpers/testUtils';
+import { click, mockEvent } from '../../../helpers/testUtils';
import UpdateForm, { UpdateFormProps } from '../UpdateForm';
it('should render', () => {
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import { mockEvent, mockQualityProfile } from '../../../../helpers/testMocks';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
+import { mockEvent } from '../../../../helpers/testUtils';
import DeleteProfileForm, { DeleteProfileFormProps } from '../DeleteProfileForm';
it('should render correctly', () => {
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import { mockEvent, mockQualityProfile } from '../../../../helpers/testMocks';
-import { change } from '../../../../helpers/testUtils';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
+import { change, mockEvent } from '../../../../helpers/testUtils';
import ProfileModalForm, { ProfileModalFormProps } from '../ProfileModalForm';
it('should render correctly', () => {
import { getStandards } from '../../../helpers/security-standard';
import {
mockCurrentUser,
- mockEvent,
mockFlowLocation,
mockLocation,
mockLoggedInUser,
mockRouter
} from '../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../helpers/testUtils';
+import { mockEvent, waitAndUpdate } from '../../../helpers/testUtils';
import { SecurityStandard } from '../../../types/security';
import {
HotspotResolution,
import BoxedTabs, { BoxedTabsProps } from '../../../../components/controls/BoxedTabs';
import { KeyboardKeys } from '../../../../helpers/keycodes';
import { mockHotspot, mockHotspotRule } from '../../../../helpers/mocks/security-hotspots';
-import { mockEvent, mockUser } from '../../../../helpers/testMocks';
+import { mockUser } from '../../../../helpers/testMocks';
+import { mockEvent } from '../../../../helpers/testUtils';
import HotspotViewerTabs, { TabKeys } from '../HotspotViewerTabs';
const originalAddEventListener = window.addEventListener;
import * as React from 'react';
import { ResetButtonLink } from '../../../../../components/controls/buttons';
import { mockGithubBindingDefinition } from '../../../../../helpers/mocks/alm-settings';
-import { mockEvent } from '../../../../../helpers/testMocks';
-import { click } from '../../../../../helpers/testUtils';
+import { click, mockEvent } from '../../../../../helpers/testUtils';
import { AlmKeys } from '../../../../../types/alm-settings';
import AlmBindingDefinitionFormRenderer, {
AlmBindingDefinitionFormProps
import * as React from 'react';
import { KeyboardKeys } from '../../../../../helpers/keycodes';
import { mockSetting } from '../../../../../helpers/mocks/settings';
-import { mockEvent } from '../../../../../helpers/testMocks';
-import { change } from '../../../../../helpers/testUtils';
+import { change, mockEvent } from '../../../../../helpers/testUtils';
import SimpleInput, { SimpleInputProps } from '../SimpleInput';
it('should render input', () => {
import { shallow } from 'enzyme';
import * as React from 'react';
import { parseDate } from '../../../helpers/dates';
-import { mockEvent } from '../../../helpers/testMocks';
+import { mockEvent } from '../../../helpers/testUtils';
import GraphsTooltips from '../GraphsTooltips';
import { DEFAULT_GRAPH } from '../utils';
import { AutoSizer, AutoSizerProps } from 'react-virtualized/dist/commonjs/AutoSizer';
import { mockComponentMeasureEnhanced } from '../../../helpers/mocks/component';
import { mockHtmlElement } from '../../../helpers/mocks/dom';
-import { mockEvent } from '../../../helpers/testMocks';
-import { click } from '../../../helpers/testUtils';
+import { click, mockEvent } from '../../../helpers/testUtils';
import { ComponentMeasureEnhanced } from '../../../types/types';
import BubbleChart from '../BubbleChart';
import * as React from 'react';
import { dismissAnalysisWarning, getTask } from '../../../api/ce';
import { mockTaskWarning } from '../../../helpers/mocks/tasks';
-import { mockCurrentUser, mockEvent } from '../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../helpers/testUtils';
+import { mockCurrentUser } from '../../../helpers/testMocks';
+import { mockEvent, waitAndUpdate } from '../../../helpers/testUtils';
import { AnalysisWarningsModal } from '../AnalysisWarningsModal';
jest.mock('../../../api/ce', () => ({
import { shallow } from 'enzyme';
import * as React from 'react';
import { changePassword } from '../../../api/users';
-import { mockEvent, mockLoggedInUser } from '../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../helpers/testUtils';
+import { mockLoggedInUser } from '../../../helpers/testMocks';
+import { mockEvent, waitAndUpdate } from '../../../helpers/testUtils';
import ResetPasswordForm from '../ResetPasswordForm';
jest.mock('../../../api/users', () => ({
import { shallow } from 'enzyme';
import * as React from 'react';
import { scrollToElement } from '../../../helpers/scrolling';
-import { mockEvent } from '../../../helpers/testMocks';
+import { mockEvent } from '../../../helpers/testUtils';
import DocMarkdownBlock from '../DocMarkdownBlock';
const CONTENT = `
import { shallow } from 'enzyme';
import * as React from 'react';
import { KeyboardKeys } from '../../../../helpers/keycodes';
-import { mockEvent } from '../../../../helpers/testMocks';
-import { click } from '../../../../helpers/testUtils';
+import { click, mockEvent } from '../../../../helpers/testUtils';
import CommentPopup, { CommentPopupProps } from '../CommentPopup';
it('should render the comment popup correctly without existing comment', () => {
import * as React from 'react';
import { generateToken, getTokens, revokeToken } from '../../../../api/user-tokens';
import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockEvent, mockLoggedInUser } from '../../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../../helpers/testUtils';
+import { mockLoggedInUser } from '../../../../helpers/testMocks';
+import { mockEvent, waitAndUpdate } from '../../../../helpers/testUtils';
import { getUniqueTokenName } from '../../utils';
import EditTokenModal from '../EditTokenModal';
};
}
-export function mockEvent(overrides = {}) {
- return {
- target: { blur() {} },
- currentTarget: { blur() {} },
- preventDefault() {},
- stopPropagation() {},
- ...overrides
- } as any;
-}
-
export function mockRawIssue(withLocations = false, overrides: Partial<RawIssue> = {}): RawIssue {
const rawIssue: RawIssue = {
actions: [],