Skip to content

Commit

Permalink
MNT ESLint issues (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabina-talipova authored Jul 9, 2023
1 parent 12ef95f commit 580da08
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 25 deletions.
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',
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: {
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

0 comments on commit 580da08

Please sign in to comment.