Skip to content

Commit

Permalink
Fix eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Jun 4, 2020
1 parent e2e8535 commit fe734bd
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ export const setup = async (): Promise<IndexTemplatesTabTestBed> => {
const selectDetailsTab = (tab: 'summary' | 'settings' | 'mappings' | 'aliases') => {
const tabs = ['summary', 'settings', 'mappings', 'aliases'];

testBed
.find('templateDetails.tab')
.at(tabs.indexOf(tab))
.simulate('click');
testBed.find('templateDetails.tab').at(tabs.indexOf(tab)).simulate('click');
};

const clickReloadButton = () => {
Expand All @@ -100,10 +97,7 @@ export const setup = async (): Promise<IndexTemplatesTabTestBed> => {

clickActionMenu(templateName);

component
.find('.euiContextMenuItem')
.at(actions.indexOf(action))
.simulate('click');
component.find('.euiContextMenuItem').at(actions.indexOf(action)).simulate('click');
};

const clickTemplateAt = async (index: number) => {
Expand Down Expand Up @@ -136,9 +130,7 @@ export const setup = async (): Promise<IndexTemplatesTabTestBed> => {

// Then click on a filter item
act(() => {
find('filterList.filterItem')
.at(views.indexOf(view))
.simulate('click');
find('filterList.filterItem').at(views.indexOf(view)).simulate('click');
});
component.update();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { setupEnvironment, getRandomString } from '../helpers';
import { IndexTemplatesTabTestBed, setup } from './index_templates_tab.helpers';

const removeWhiteSpaceOnArrayValues = (array: any[]) =>
array.map(value => {
array.map((value) => {
if (!value.trim) {
return value;
}
Expand Down Expand Up @@ -200,7 +200,7 @@ describe('Index Templates tab', () => {
const { rows } = table.getMetaData('legacyTemplateTable');

expect(rows.length).toEqual(
legacyTemplates.filter(template => !template.name.startsWith('.')).length
legacyTemplates.filter((template) => !template.name.startsWith('.')).length
);

expect(exists('viewButton')).toBe(true);
Expand Down Expand Up @@ -284,7 +284,7 @@ describe('Index Templates tab', () => {
});

test('should send the correct HTTP request to delete an index template', async () => {
const { component, actions, table } = testBed;
const { actions, table } = testBed;
const { rows } = table.getMetaData('legacyTemplateTable');

const templateId = rows[0].columns[2].value;
Expand Down Expand Up @@ -417,7 +417,7 @@ describe('Index Templates tab', () => {
await actions.clickTemplateAt(0);

expect(find('templateDetails.tab').length).toBe(4);
expect(find('templateDetails.tab').map(t => t.text())).toEqual([
expect(find('templateDetails.tab').map((t) => t.text())).toEqual([
'Summary',
'Settings',
'Mappings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ describe('<IndexManagementHome />', () => {

component.update();

find('indexTableIndexNameLink')
.at(0)
.simulate('click');
find('indexTableIndexNameLink').at(0).simulate('click');
});

test('should encode indexName when loading settings in detail panel', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ describe.skip('<TemplateCreate />', () => {
expect(
find('summaryTabContent')
.find('.euiTab')
.map(t => t.text())
.map((t) => t.text())
).toEqual(['Summary', 'Request']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ export const LegacyTemplateTable: React.FunctionComponent<Props> = ({
values={{ count: selection.length }}
/>
</EuiButton>
) : (
undefined
),
) : undefined,
toolsRight: [
<EuiButton
iconType="plusInCircle"
Expand All @@ -268,7 +266,7 @@ export const LegacyTemplateTable: React.FunctionComponent<Props> = ({
<Fragment>
{templatesToDelete && templatesToDelete.length > 0 ? (
<TemplateDeleteModal
callback={data => {
callback={(data) => {
if (data && data.hasDeletedTemplates) {
reload();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface MatchParams {
}

const stripOutSystemTemplates = (templates: TemplateListItem[]): TemplateListItem[] =>
templates.filter(template => !template.name.startsWith('.'));
templates.filter((template) => !template.name.startsWith('.'));

export const TemplateList: React.FunctionComponent<RouteComponentProps<MatchParams>> = ({
match: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const TemplateTable: React.FunctionComponent<Props> = ({ templates, reloa
<Fragment>
{templatesToDelete && templatesToDelete.length > 0 ? (
<TemplateDeleteModal
callback={data => {
callback={(data) => {
if (data && data.hasDeletedTemplates) {
reload();
} else {
Expand Down

0 comments on commit fe734bd

Please sign in to comment.