export interface AdminContainerProps {
appState: AppState;
- location: {};
children: React.ReactElement;
}
extensions={adminPages}
fetchPendingPlugins={this.fetchPendingPlugins}
fetchSystemStatus={this.fetchSystemStatus}
- location={this.props.location}
pendingPlugins={pendingPlugins}
systemStatus={systemStatus}
/>
import * as React from 'react';
import { Alert } from '../../components/ui/Alert';
import { translate } from '../../helpers/l10n';
-import { BranchLike } from '../../types/branch-like';
import { isApplication } from '../../types/component';
import { Component } from '../../types/types';
export interface NonAdminPagesContainerProps {
children: JSX.Element;
- branchLike?: BranchLike;
- branchLikes: BranchLike[];
component: Component;
- isInProgress?: boolean;
- isPending?: boolean;
- onBranchesChange: () => void;
- onComponentChange: (changes: {}) => void;
}
export default function NonAdminPagesContainer(props: NonAdminPagesContainerProps) {
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import { mockAppState, mockLocation } from '../../../helpers/testMocks';
+import { mockAppState } from '../../../helpers/testMocks';
import { AdminContainer, AdminContainerProps } from '../AdminContainer';
jest.mock('../../../api/plugins', () => ({
appState={mockAppState({
canAdmin: true
})}
- location={mockLocation()}
{...props}>
<div />
</AdminContainer>
function shallowRender(props: Partial<NonAdminPagesContainerProps> = {}) {
return shallow<NonAdminPagesContainerProps>(
- <NonAdminPagesContainer
- branchLikes={[]}
- component={mockComponent()}
- onBranchesChange={jest.fn()}
- onComponentChange={jest.fn()}
- {...props}>
+ <NonAdminPagesContainer component={mockComponent()} {...props}>
<Child />
</NonAdminPagesContainer>
);
extensions={Array []}
fetchPendingPlugins={[Function]}
fetchSystemStatus={[Function]}
- location={
- Object {
- "action": "PUSH",
- "hash": "",
- "key": "key",
- "pathname": "/path",
- "query": Object {},
- "search": "",
- "state": Object {},
- }
- }
pendingPlugins={
Object {
"installing": Array [],
component: Component;
}
-export function PortfolioPage({ component, location }: PortfolioPageProps) {
+export function PortfolioPage({ component }: PortfolioPageProps) {
return (
<ProjectPageExtension
component={component}
params={{ pluginKey: 'governance', extensionKey: 'portfolio' }}
- location={location}
/>
);
}
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Location } from 'history';
import * as React from 'react';
import { connect } from 'react-redux';
import { addGlobalErrorMessage } from '../../../store/globalMessages';
export interface ProjectAdminPageExtensionProps {
component: Component;
- location: Location;
params: { extensionKey: string; pluginKey: string };
}
export interface ProjectPageExtensionProps {
branchLike?: BranchLike;
component: Component;
- location: { query: { id: string } };
params: {
extensionKey: string;
pluginKey: string;
import { shallow } from 'enzyme';
import * as React from 'react';
import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLocation } from '../../../../helpers/testMocks';
import {
ProjectAdminPageExtension,
ProjectAdminPageExtensionProps
return shallow(
<ProjectAdminPageExtension
component={mockComponent()}
- location={mockLocation()}
params={{ extensionKey: 'bar', pluginKey: 'foo' }}
{...props}
/>
import * as React from 'react';
import { mockMainBranch } from '../../../../helpers/mocks/branch-like';
import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLocation } from '../../../../helpers/testMocks';
import ProjectPageExtension, { ProjectPageExtensionProps } from '../ProjectPageExtension';
it('should render correctly', () => {
component={mockComponent({
extensions: [{ key: 'plugin-key/extension-key', name: 'plugin' }]
})}
- location={mockLocation()}
params={{ extensionKey: 'extension-key', pluginKey: 'plugin-key' }}
{...props}
/>
"tags": Array [],
}
}
- location={
- Object {
- "action": "PUSH",
- "hash": "",
- "key": "key",
- "pathname": "/path",
- "query": Object {},
- "search": "",
- "state": Object {},
- }
- }
params={
Object {
"extensionKey": "portfolio",
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+/* eslint-disable react/no-unused-prop-types */
+
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
};
render() {
- const { key } = this.props.component;
const tags = this.props.component.tags || [];
if (this.canUpdateTags()) {
closeOnClick={false}
closeOnClickOutside={true}
overlay={
- <MetaTagsSelector
- project={key}
- selectedTags={tags}
- setProjectTags={this.handleSetProjectTags}
- />
+ <MetaTagsSelector selectedTags={tags} setProjectTags={this.handleSetProjectTags} />
}
overlayPlacement={PopupPlacement.BottomLeft}>
<ButtonLink innerRef={tagsList => (this.tagsList = tagsList)} stopPropagation={true}>
import TagsSelector from '../../../../../../components/tags/TagsSelector';
interface Props {
- project: string;
selectedTags: string[];
setProjectTags: (tags: string[]) => void;
}
(searchProjectTags as jest.Mock).mockImplementation(() =>
Promise.resolve({ tags: ['foo', 'bar'] })
);
- mount(<MetaTagsSelector project="foo" selectedTags={[]} setProjectTags={jest.fn()} />);
+ mount(<MetaTagsSelector selectedTags={[]} setProjectTags={jest.fn()} />);
expect(searchProjectTags).toBeCalledWith({ ps: 9, q: '' });
});
it('selects and deselects tags', () => {
const setProjectTags = jest.fn();
const wrapper = shallow(
- <MetaTagsSelector project="foo" selectedTags={['foo', 'bar']} setProjectTags={setProjectTags} />
+ <MetaTagsSelector selectedTags={['foo', 'bar']} setProjectTags={setProjectTags} />
);
const tagSelect: any = wrapper.find('TagsSelector');
closeOnClickOutside={true}
overlay={
<MetaTagsSelector
- project="my-second-project"
selectedTags={
Array [
"foo",
<ul className="global-navbar-menu global-navbar-menu-right">
<EmbedDocsPopupHelper />
- <Search currentUser={currentUser} />
+ <Search />
<GlobalNavUser currentUser={currentUser} />
</ul>
</NavBar>
className="global-navbar-menu global-navbar-menu-right"
>
<EmbedDocsPopupHelper />
- <withRouter(Search)
- currentUser={
- Object {
- "isLoggedIn": false,
- }
- }
- />
+ <withRouter(Search) />
<withRouter(GlobalNavUser)
currentUser={
Object {
className="global-navbar-menu global-navbar-menu-right"
>
<EmbedDocsPopupHelper />
- <withRouter(Search)
- currentUser={
- Object {
- "isLoggedIn": true,
- }
- }
- />
+ <withRouter(Search) />
<withRouter(GlobalNavUser)
currentUser={
Object {
extensions: Extension[];
fetchPendingPlugins: () => void;
fetchSystemStatus: () => void;
- location: {};
pendingPlugins: PendingPluginResult;
systemStatus: SysStatus;
}
extensions={[{ key: 'foo', name: 'Foo' }]}
fetchPendingPlugins={jest.fn()}
fetchSystemStatus={jest.fn()}
- location={{}}
pendingPlugins={{ installing: [], removing: [], updating: [] }}
systemStatus="UP"
{...props}
import { getComponentOverviewUrl } from '../../../helpers/urls';
import { ComponentQualifier } from '../../../types/component';
import { Dict } from '../../../types/types';
-import { CurrentUser } from '../../../types/users';
import RecentHistory from '../RecentHistory';
import './Search.css';
import { ComponentResult, More, Results, sortQualifiers } from './utils';
const SearchResults = lazyLoadComponent(() => import('./SearchResults'));
const SearchResult = lazyLoadComponent(() => import('./SearchResult'));
-interface OwnProps {
- currentUser: CurrentUser;
-}
-
-type Props = OwnProps & WithRouterProps;
-
interface State {
loading: boolean;
loadingMore?: string;
shortQuery: boolean;
}
-export class Search extends React.PureComponent<Props, State> {
+export class Search extends React.PureComponent<WithRouterProps, State> {
input?: HTMLInputElement | null;
node?: HTMLElement | null;
nodes: Dict<HTMLElement>;
mounted = false;
- constructor(props: Props) {
+ constructor(props: WithRouterProps) {
super(props);
this.nodes = {};
this.search = debounce(this.search, 250);
this.nodes = {};
}
- componentDidUpdate(_prevProps: Props, prevState: State) {
+ componentDidUpdate(_prevProps: WithRouterProps, prevState: State) {
if (prevState.selected !== this.state.selected) {
this.scrollToSelected();
}
}
}
-export default withRouter<OwnProps>(Search);
+export default withRouter<{}>(Search);
import HelpTooltip from '../../../components/controls/HelpTooltip';
import { translate } from '../../../helpers/l10n';
import { formatMeasure } from '../../../helpers/measures';
-import { Component } from '../../../types/types';
// Do not display the pending time for values smaller than this threshold (in ms)
const MIN_PENDING_TIME_THRESHOLD = 1000;
export interface Props {
className?: string;
- component?: Pick<Component, 'key'>;
pendingCount?: number;
pendingTime?: number;
}
modalHeader: string;
onClose: () => void;
onDone: (severity: string) => Promise<void>;
+ // eslint-disable-next-line react/no-unused-prop-types
profiles: Profile[];
rule: Rule | RuleDetails;
}
{rules.map(rule => (
<RuleListItem
activation={this.getRuleActivation(rule.key)}
- canWrite={this.state.canWrite}
isLoggedIn={isLoggedIn(this.props.currentUser)}
key={rule.key}
onActivate={this.handleRuleActivate}
{!ruleDetails.isTemplate && (
<RuleDetailsProfiles
activations={this.state.actives}
- canWrite={canWrite}
onActivate={this.handleActivate}
onDeactivate={this.handleDeactivate}
referencedProfiles={referencedProfiles}
interface Props {
activations: RuleActivation[] | undefined;
- canWrite: boolean | undefined;
onActivate: () => Promise<void>;
onDeactivate: () => Promise<void>;
referencedProfiles: Dict<Profile>;
interface Props {
activation?: Activation;
- canWrite?: boolean;
isLoggedIn: boolean;
onActivate: (profile: string, rule: string, activation: Activation) => void;
onDeactivate: (profile: string, rule: string) => void;
className="layout-page-main-inner"
>
<RuleListItem
- canWrite={true}
isLoggedIn={true}
key="javascript:S1067"
onActivate={[Function]}
selected={true}
/>
<RuleListItem
- canWrite={true}
isLoggedIn={true}
key="javascript:S1067"
onActivate={[Function]}
return (
<TreeMapView
- branchLike={this.props.branchLike}
components={this.state.components}
handleSelect={this.onOpenComponent}
metric={metric}
return (
<BubbleChart
- component={component}
components={this.state.components}
domain={domain}
metrics={metrics}
loading={false}
/>
<BubbleChart
- component={
- Object {
- "key": "foo",
- "measures": Array [
- Object {
- "bestValue": false,
- "metric": "bugs",
- "value": "12",
- },
- ],
- "name": "Foo",
- "qualifier": "TRK",
- }
- }
components={Array []}
domain="Reliability"
metrics={
loading={false}
/>
<BubbleChart
- component={
- Object {
- "key": "foo",
- "measures": Array [
- Object {
- "bestValue": false,
- "metric": "bugs",
- "value": "12",
- },
- ],
- "name": "Foo",
- "qualifier": "TRK",
- }
- }
components={Array []}
domain="Reliability"
metrics={
import { isDefined } from '../../../helpers/types';
import { isProject } from '../../../types/component';
import {
- ComponentMeasure,
ComponentMeasureEnhanced,
ComponentMeasureIntern,
Dict,
const HEIGHT = 500;
interface Props {
- component: ComponentMeasure;
components: ComponentMeasureEnhanced[];
domain: string;
metrics: Dict<Metric>;
import { getLocalizedMetricName, translate, translateWithParameters } from '../../../helpers/l10n';
import { formatMeasure, isDiffMetric } from '../../../helpers/measures';
import { isDefined } from '../../../helpers/types';
-import { BranchLike } from '../../../types/branch-like';
import { MetricKey } from '../../../types/metrics';
import { ComponentMeasureEnhanced, ComponentMeasureIntern, Metric } from '../../../types/types';
import EmptyResult from './EmptyResult';
interface Props {
- branchLike?: BranchLike;
components: ComponentMeasureEnhanced[];
handleSelect: (component: ComponentMeasureIntern) => void;
metric: Metric;
function shallowRender(overrides: Partial<BubbleChart['props']> = {}) {
return shallow<BubbleChart>(
<BubbleChart
- component={mockComponentMeasure()}
components={[
enhanceComponent(
mockComponentMeasure(true, {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+/* eslint-disable react/no-unused-prop-types */
+
import classNames from 'classnames';
import * as React from 'react';
import withAppStateContext from '../../../app/components/app-state/withAppStateContext';
import { getAlmSettings } from '../../../api/alm-settings';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import withAppStateContext from '../../../app/components/app-state/withAppStateContext';
-import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
import { translate } from '../../../helpers/l10n';
import { getProjectUrl } from '../../../helpers/urls';
import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
import { AppState } from '../../../types/appstate';
-import { LoggedInUser } from '../../../types/users';
import AlmBindingDefinitionForm from '../../settings/components/almIntegration/AlmBindingDefinitionForm';
import AzureProjectCreate from './AzureProjectCreate';
import BitbucketCloudProjectCreate from './BitbucketCloudProjectCreate';
interface Props extends Pick<WithRouterProps, 'router' | 'location'> {
appState: AppState;
- currentUser: LoggedInUser;
}
interface State {
}
}
-export default whenLoggedIn(withAppStateContext(CreateProjectPage));
+export default withAppStateContext(CreateProjectPage);
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+/* eslint-disable react/no-unused-prop-types */
+
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
import { shallow } from 'enzyme';
import * as React from 'react';
import { getAlmSettings } from '../../../../api/alm-settings';
-import {
- mockAppState,
- mockLocation,
- mockLoggedInUser,
- mockRouter
-} from '../../../../helpers/testMocks';
+import { mockAppState, mockLocation, mockRouter } from '../../../../helpers/testMocks';
import { waitAndUpdate } from '../../../../helpers/testUtils';
import { AlmKeys } from '../../../../types/alm-settings';
import AlmBindingDefinitionForm from '../../../settings/components/almIntegration/AlmBindingDefinitionForm';
return shallow<CreateProjectPage>(
<CreateProjectPage
appState={mockAppState()}
- currentUser={mockLoggedInUser()}
location={mockLocation()}
router={mockRouter()}
{...props}
currentUser: CurrentUser;
fetchBranchStatus: (branchLike: BranchLike, projectKey: string) => void;
location: Location;
- onBranchesChange?: () => void;
router: Pick<Router, 'push' | 'replace'>;
}
currentUser={mockLoggedInUser()}
fetchBranchStatus={jest.fn()}
location={mockLocation({ pathname: '/issues', query: {} })}
- onBranchesChange={() => {}}
router={mockRouter()}
{...props}
/>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+/* eslint-disable react/no-unused-prop-types */
+
import { omit, sortBy, without } from 'lodash';
import * as React from 'react';
import FacetBox from '../../../components/facet/FacetBox';
import * as React from 'react';
import withAppStateContext from '../../../app/components/app-state/withAppStateContext';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { Router, withRouter } from '../../../components/hoc/withRouter';
import { lazyLoadComponent } from '../../../components/lazyLoadComponent';
import { isPullRequest } from '../../../helpers/branch-like';
import { ProjectAlmBindingResponse } from '../../../types/alm-settings';
isInProgress?: boolean;
isPending?: boolean;
projectBinding?: ProjectAlmBindingResponse;
- router: Pick<Router, 'replace'>;
}
export class App extends React.PureComponent<Props> {
}
}
-export default withRouter(withAppStateContext(App));
+export default withAppStateContext(App);
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+/* eslint-disable react/no-unused-prop-types */
+
import * as React from 'react';
import Tooltip from '../../../components/controls/Tooltip';
import RatingTooltipContent from '../../../components/measure/RatingTooltipContent';
function getWrapper(props = {}) {
return shallow(
- <App
- appState={mockAppState()}
- branchLikes={[]}
- component={component}
- router={{ replace: jest.fn() }}
- {...props}
- />
+ <App appState={mockAppState()} branchLikes={[]} component={component} {...props} />
);
}
grantPermissionToUser: (login: string, permission: string) => Promise<void>;
groups: PermissionGroup[];
groupsPaging?: Paging;
- loadHolders: () => void;
loading?: boolean;
onLoadMore: () => void;
onFilter: (filter: string) => void;
grantPermissionToUser={this.grantPermissionToUser}
groups={this.state.groups}
groupsPaging={this.state.groupsPaging}
- loadHolders={this.loadHolders}
loading={this.state.loading}
onFilter={this.onFilter}
onLoadMore={this.onLoadMore}
grantPermissionToGroup={jest.fn()}
grantPermissionToUser={jest.fn()}
groups={[mockPermissionGroup()]}
- loadHolders={jest.fn()}
onLoadMore={jest.fn()}
onFilter={jest.fn()}
onSearch={jest.fn()}
grantPermissionToGroup={[Function]}
grantPermissionToUser={[Function]}
groups={Array []}
- loadHolders={[Function]}
loading={true}
onFilter={[Function]}
onLoadMore={[Function]}
"total": 2,
}
}
- loadHolders={[Function]}
loading={false}
onFilter={[Function]}
onLoadMore={[Function]}
export interface BaselineSettingReferenceBranchProps {
branchList: BranchOption[];
className?: string;
- configuredBranchName?: string;
disabled?: boolean;
onChangeReferenceBranch: (value: string) => void;
onSelect: (selection: NewCodePeriodSettingType) => void;
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot('Project level');
- expect(shallowRender({ settingLevel: 'branch', configuredBranchName: 'master' })).toMatchSnapshot(
- 'Branch level'
- );
+ expect(shallowRender({ settingLevel: 'branch' })).toMatchSnapshot('Branch level');
expect(
shallowRender({
branchList: [{ label: 'master', value: 'master', isMain: true }],
- settingLevel: 'branch',
- configuredBranchName: 'master'
+ settingLevel: 'branch'
})
).toMatchSnapshot('Branch level - no other branches');
});
import FilterHeader from './FilterHeader';
export interface Props {
- className?: string;
facet?: Facet;
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
import FilterHeader from './FilterHeader';
export interface Props {
- className?: string;
facet?: Facet;
maxFacetValue?: number;
onQueryChange: (change: RawQuery) => void;
render() {
const { submitting } = this.props;
- const { loading, query = '', searchResults, selection } = this.state;
+ const { loading, searchResults, selection } = this.state;
return (
<QualityGatePermissionsAddModalRenderer
onInputChange={this.handleInputChange}
onSelection={this.handleSelection}
onSubmit={this.handleSubmit}
- query={query}
searchResults={searchResults}
selection={selection}
submitting={submitting}
onSelection: (selection: Option) => void;
submitting: boolean;
loading: boolean;
- query: string;
searchResults: Array<UserBase | Group>;
selection?: UserBase | Group;
}
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot('default');
- expect(shallowRender({ query: 'a' })).toMatchSnapshot('short query');
expect(shallowRender({ selection: mockUserBase() })).toMatchSnapshot('selection');
expect(shallowRender({ selection: mockUserBase(), submitting: true })).toMatchSnapshot(
'submitting'
);
expect(
- shallowRender({ query: 'ab', searchResults: [mockUserBase(), { name: 'group name' }] })
+ shallowRender({ searchResults: [mockUserBase(), { name: 'group name' }] })
).toMatchSnapshot('query and results');
});
onInputChange={jest.fn()}
onSelection={jest.fn()}
onSubmit={jest.fn()}
- query=""
searchResults={[]}
submitting={false}
{...overrides}
onInputChange={[Function]}
onSelection={[Function]}
onSubmit={[Function]}
- query=""
searchResults={Array []}
submitting={false}
/>
</Modal>
`;
-exports[`should render correctly: short query 1`] = `
-<Modal
- contentLabel="quality_gates.permissions.grant"
- onRequestClose={[MockFunction]}
->
- <header
- className="modal-head"
- >
- <h2>
- quality_gates.permissions.grant
- </h2>
- </header>
- <form
- onSubmit={[MockFunction]}
- >
- <div
- className="modal-body"
- >
- <div
- className="modal-field"
- >
- <label>
- quality_gates.permissions.search
- </label>
- <Select
- autoFocus={true}
- className="Select-big"
- components={
- Object {
- "Control": [Function],
- "Option": [Function],
- "SingleValue": [Function],
- }
- }
- filterOptions={[Function]}
- isClearable={false}
- isLoading={false}
- isSearchable={true}
- noOptionsMessage={[Function]}
- onChange={[MockFunction]}
- onInputChange={[MockFunction]}
- options={Array []}
- placeholder=""
- />
- </div>
- </div>
- <footer
- className="modal-foot"
- >
- <SubmitButton
- disabled={true}
- >
- add_verb
- </SubmitButton>
- <ResetButtonLink
- onClick={[MockFunction]}
- >
- cancel
- </ResetButtonLink>
- </footer>
- </form>
-</Modal>
-`;
-
exports[`should render correctly: submitting 1`] = `
<Modal
contentLabel="quality_gates.permissions.grant"
interface Props {
className?: string;
- fromList?: boolean;
profile: Profile;
router: Pick<Router, 'push' | 'replace'>;
updateProfiles: () => Promise<void>;
</td>
<td className="quality-profiles-table-actions thin nowrap text-middle text-right">
- <ProfileActions fromList={true} profile={profile} updateProfiles={props.updateProfiles} />
+ <ProfileActions profile={profile} updateProfiles={props.updateProfiles} />
</td>
</tr>
);
className="quality-profiles-table-actions thin nowrap text-middle text-right"
>
<withRouter(ProfileActions)
- fromList={true}
profile={
Object {
"activeDeprecatedRuleCount": 2,
className="quality-profiles-table-actions thin nowrap text-middle text-right"
>
<withRouter(ProfileActions)
- fromList={true}
profile={
Object {
"activeDeprecatedRuleCount": 0,
className="quality-profiles-table-actions thin nowrap text-middle text-right"
>
<withRouter(ProfileActions)
- fromList={true}
profile={
Object {
"activeDeprecatedRuleCount": 2,
className="quality-profiles-table-actions thin nowrap text-middle text-right"
>
<withRouter(ProfileActions)
- fromList={true}
profile={
Object {
"activeDeprecatedRuleCount": 10,
<OAuthProviders identityProviders={identityProviders} returnTo={returnTo} />
)}
- <LoginForm
- collapsed={identityProviders.length > 0}
- onSubmit={props.onSubmit}
- returnTo={returnTo}
- />
+ <LoginForm collapsed={identityProviders.length > 0} onSubmit={props.onSubmit} />
<GlobalMessagesContainer />
</div>
interface Props {
collapsed?: boolean;
onSubmit: (login: string, password: string) => Promise<void>;
- returnTo: string;
}
interface State {
it('logs in with simple credentials', () => {
const onSubmit = jest.fn(() => Promise.resolve());
- const wrapper = shallow(<LoginForm onSubmit={onSubmit} returnTo="" />);
+ const wrapper = shallow(<LoginForm onSubmit={onSubmit} />);
expect(wrapper).toMatchSnapshot();
change(wrapper.find('#login'), 'admin');
it('should display a spinner and disabled button while loading', async () => {
const onSubmit = jest.fn(() => Promise.resolve());
- const wrapper = shallow(<LoginForm onSubmit={onSubmit} returnTo="" />);
+ const wrapper = shallow(<LoginForm onSubmit={onSubmit} />);
change(wrapper.find('#login'), 'admin');
change(wrapper.find('#password'), 'admin');
});
it('expands more options', () => {
- const wrapper = shallow(<LoginForm collapsed={true} onSubmit={jest.fn()} returnTo="" />);
+ const wrapper = shallow(<LoginForm collapsed={true} onSubmit={jest.fn()} />);
expect(wrapper).toMatchSnapshot();
click(wrapper.find('.js-more-options'));
<LoginForm
collapsed={true}
onSubmit={[MockFunction]}
- returnTo=""
/>
<Connect(GlobalMessages) />
</div>
<LoginForm
collapsed={true}
onSubmit={[MockFunction]}
- returnTo=""
/>
<Connect(GlobalMessages) />
</div>
<LoginForm
collapsed={false}
onSubmit={[MockFunction]}
- returnTo=""
/>
<Connect(GlobalMessages) />
</div>
import WebhooksList from './WebhooksList';
interface Props {
+ // eslint-disable-next-line react/no-unused-prop-types
component?: LightComponent;
}
return (
<SourceViewerCode
branchLike={this.props.branchLike}
- componentKey={this.props.component}
displayAllIssues={this.props.displayAllIssues}
displayIssueLocationsCount={this.props.displayIssueLocationsCount}
displayIssueLocationsLink={this.props.displayIssueLocationsLink}
interface Props {
branchLike: BranchLike | undefined;
- componentKey: string;
displayAllIssues?: boolean;
displayIssueLocationsCount?: boolean;
displayIssueLocationsLink?: boolean;
return shallow<SourceViewerCode>(
<SourceViewerCode
branchLike={mockBranch()}
- componentKey="foo"
duplications={[]}
duplicationsByLine={[]}
hasSourcesAfter={false}
"name": "master",
}
}
- componentKey="my-component"
displayAllIssues={false}
displayIssueLocationsCount={true}
displayIssueLocationsLink={true}
interface Props {
addMetric: (metric: string) => void;
- className?: string;
metrics: Metric[];
metricsTypeFilter?: string[];
removeMetric: (metric: string) => void;
removeCustomMetric !== undefined && (
<AddGraphMetric
addMetric={addCustomMetric}
- className="pull-left spacer-left"
metrics={metrics}
metricsTypeFilter={metricsTypeFilter}
removeMetric={removeCustomMetric}
allowNewElements?: boolean;
allowSelection?: boolean;
elements: string[];
+ // eslint-disable-next-line react/no-unused-prop-types
filterSelected?: (query: string, selectedElements: string[]) => string[];
footerNode?: React.ReactNode;
listSize?: number;
import { formatMeasure } from '../../helpers/measures';
interface Props {
- className?: string;
count: number;
showMore: () => void;
showLess: (() => void) | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+/* eslint-disable react/no-unused-prop-types */
+
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { rawSizes } from '../../../app/theme';