mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
MNT ESLint issues (#2865)
This commit is contained in:
parent
e91b7c7f8e
commit
643801a01b
@ -153,8 +153,8 @@ AnchorSelectorField.propTypes = {
|
|||||||
pageId: PropTypes.number,
|
pageId: PropTypes.number,
|
||||||
anchors: PropTypes.array,
|
anchors: PropTypes.array,
|
||||||
loadingState: PropTypes.oneOf(Object
|
loadingState: PropTypes.oneOf(Object
|
||||||
.keys(anchorSelectorStates)
|
.keys(anchorSelectorStates)
|
||||||
.map((key) => anchorSelectorStates[key])),
|
.map((key) => anchorSelectorStates[key])),
|
||||||
onLoadingError: PropTypes.func,
|
onLoadingError: PropTypes.func,
|
||||||
data: PropTypes.shape({
|
data: PropTypes.shape({
|
||||||
endpoint: PropTypes.string,
|
endpoint: PropTypes.string,
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/* global jest, test, describe, beforeEach, it, expect, setTimeout */
|
/* global jest, test, describe, beforeEach, it, expect, setTimeout */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Component as AnchorSelectorField } from '../AnchorSelectorField';
|
|
||||||
import anchorSelectorStates from 'state/anchorSelector/AnchorSelectorStates';
|
import anchorSelectorStates from 'state/anchorSelector/AnchorSelectorStates';
|
||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
|
import { Component as AnchorSelectorField } from '../AnchorSelectorField';
|
||||||
|
|
||||||
jest.mock('isomorphic-fetch', () =>
|
jest.mock('isomorphic-fetch', () =>
|
||||||
() => Promise.resolve({
|
() => Promise.resolve({
|
||||||
json: () => ['anchor3', 'anchor4'],
|
json: () => ['anchor3', 'anchor4'],
|
||||||
}));
|
}));
|
||||||
jest.mock('i18n');
|
jest.mock('i18n');
|
||||||
|
|
||||||
function makeProps(obj = {}) {
|
function makeProps(obj = {}) {
|
||||||
@ -50,7 +50,7 @@ test('AnchorSelectorField componentDidMount() Loads dirty selectors', async () =
|
|||||||
|
|
||||||
test('AnchorSelectorField Merges value with page anchors', async () => {
|
test('AnchorSelectorField Merges value with page anchors', async () => {
|
||||||
const beginUpdating = jest.fn();
|
const beginUpdating = jest.fn();
|
||||||
const { container } = render(<AnchorSelectorField {...makeProps({
|
render(<AnchorSelectorField {...makeProps({
|
||||||
loadingState: anchorSelectorStates.DIRTY,
|
loadingState: anchorSelectorStates.DIRTY,
|
||||||
actions: {
|
actions: {
|
||||||
anchorSelector: {
|
anchorSelector: {
|
||||||
|
@ -88,11 +88,11 @@ const config = {
|
|||||||
versions: {
|
versions: {
|
||||||
...versions,
|
...versions,
|
||||||
goToPage(page) {
|
goToPage(page) {
|
||||||
refetch({
|
refetch({
|
||||||
offset: ((page || 1) - 1) * limit,
|
offset: ((page || 1) - 1) * limit,
|
||||||
limit,
|
limit,
|
||||||
page_id: recordId,
|
page_id: recordId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user