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

MNT ESLint issues #271

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* global jest, test, describe, it, expect */

import React from 'react';
import IntroScreen from '../IntroScreen';
import { render } from '@testing-library/react';
import IntroScreen from '../IntroScreen';

test('IntroScreen renders when show is true', () => {
const { container } = render(
Expand Down
5 changes: 2 additions & 3 deletions client/src/containers/CampaignAdmin/CampaignAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import IntroScreen from 'components/IntroScreen/IntroScreen';
import ResizeAware from 'components/ResizeAware/ResizeAware';
import withRouter, { routerPropTypes } from 'lib/withRouter';
import * as viewModeActions from 'state/viewMode/ViewModeActions';
import CampaignAdminList from './CampaignAdminList';
import { joinUrlPaths } from 'lib/urls';
import CampaignAdminList from './CampaignAdminList';

const sectionConfigKey = 'SilverStripe\\CampaignAdmin\\CampaignAdmin';

Expand Down Expand Up @@ -137,7 +137,6 @@ class CampaignAdmin extends Component {
}
}


/**
* Handler for creating campaign, will redirect to edit form
*
Expand Down Expand Up @@ -325,7 +324,7 @@ By removing this item all linked items will be removed unless used elsewhere.`;
const extendedProps = {
...props,
data: {
...props.data,
...props.data,
onDrillDown: (event, record) => {
navigate(joinUrlPaths('/', reactRoutePath, `${typeUrlParam}/${record.ID}/show`));
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/CampaignAdmin/CampaignAdminList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import Accordion from 'components/Accordion/Accordion';
import AccordionBlock from 'components/Accordion/AccordionBlock';
import ListGroupItem from 'components/ListGroup/ListGroupItem';
import Toolbar from 'components/Toolbar/Toolbar';
import CampaignAdminItem from './CampaignAdminItem';
import Breadcrumb from 'components/Breadcrumb/Breadcrumb';
import { DropdownItem } from 'reactstrap';
import i18n from 'i18n';
import { inject } from 'lib/Injector';
import classNames from 'classnames';
import { joinUrlPaths } from 'lib/urls';
import CampaignAdminItem from './CampaignAdminItem';

/**
* Represents a campaign list view
Expand Down Expand Up @@ -309,7 +309,7 @@ class CampaignAdminList extends Component {
<FormActionComponent {...actionProps} />
{!empty && <ViewModeComponent
id="view-mode-toggle-in-edit-nb"
area={'edit'}
area="edit"
/>}
</div>
);
Expand Down
20 changes: 7 additions & 13 deletions client/src/containers/CampaignAdmin/tests/CampaignAdmin-test.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
/* global jest, test, describe, beforeEach, it, expect */

import { Component as CampaignAdmin } from '../CampaignAdmin';
import { fireEvent, render, screen } from '@testing-library/react';
import React from 'react';

import { Component as CampaignAdmin } from '../CampaignAdmin';

let mockResponse;

function makeProps(obj = {}) {
return {
sectionConfig: {
reactRoutePath: '',
reactRoutePath: '/campaigns',
emteknetnz marked this conversation as resolved.
Show resolved Hide resolved
publishEndpoint: {
url: '/',
method: 'get',
},
form: {
EditForm: {
schemaUrl: 'schemaEditForm',
schemaUrl: 'schemaEditForm'
},
},
campaignCreateForm: {
schemaUrl: '/my/schema'
}
}
},
breadcrumbsActions: {
setBreadcrumbs: jest.fn(),
Expand All @@ -40,14 +42,6 @@ function makeProps(obj = {}) {
view: null
}
},
sectionConfig: {
emteknetnz marked this conversation as resolved.
Show resolved Hide resolved
form: {
campaignCreateForm: {
schemaUrl: '/my/schema'
}
},
reactRoutePath: '/campaigns',
},
router: {
params: {
view: 'create'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* global jest, test, describe, beforeEach, it, expect */

import React from 'react';
import { Component as CampaignAdminList } from '../CampaignAdminList';
import { render, screen } from '@testing-library/react';
import { Component as CampaignAdminList } from '../CampaignAdminList';

function makeProps(obj = {}) {
return {
Expand Down
2 changes: 1 addition & 1 deletion client/src/state/campaign/CampaignActions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* global window */
import ACTION_TYPES from './CampaignActionTypes';
import RECORD_ACTION_TYPES from 'state/records/RecordsActionTypes';
import * as toastsActions from 'state/toasts/ToastsActions';
import i18n from 'i18n';
import ACTION_TYPES from './CampaignActionTypes';

export function setShowMessage(show, storage = window.localStorage) {
storage.setItem('campaign.showMessage', show);
Expand Down
5 changes: 2 additions & 3 deletions client/src/state/campaign/tests/CampaignActions-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* global jest, jasmine, describe, it, expect, beforeEach */

import * as actions from '../CampaignActions';
import ACTION_TYPES from '../CampaignActionTypes';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';

import * as actions from '../CampaignActions';
import ACTION_TYPES from '../CampaignActionTypes';

describe('CampaignActions', () => {
const middlewares = [thunk];
Expand Down