Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
Browse files Browse the repository at this point in the history
…-fix'
  • Loading branch information
kibanamachine committed Apr 20, 2022
1 parent 0576f50 commit 31aa11b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React, { useState } from 'react';
import { RuleStateFilterProps } from '../../../../public/types';
import { RuleStateFilterProps } from '../../../types';
import { getRuleStateFilterLazy } from '../../../common/get_rule_state_filter';

export const RuleStateFilterSandbox = () => {
Expand All @@ -18,9 +18,7 @@ export const RuleStateFilterSandbox = () => {
selectedStates,
onChange: setSelectedStates,
})}
<div>
Selected states: {JSON.stringify(selectedStates)}
</div>
<div>Selected states: {JSON.stringify(selectedStates)}</div>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ describe('rule_state_filter', () => {
});

it('renders correctly', () => {
const wrapper = mountWithIntl(
<RuleStateFilter
selectedStates={[]}
onChange={onChangeMock}
/>
);
const wrapper = mountWithIntl(<RuleStateFilter selectedStates={[]} onChange={onChangeMock} />);

expect(wrapper.find(EuiFilterSelectItem).exists()).toBeFalsy();
expect(wrapper.find(EuiFilterButton).exists()).toBeTruthy();
Expand All @@ -32,12 +27,7 @@ describe('rule_state_filter', () => {
});

it('can open the popover correctly', () => {
const wrapper = mountWithIntl(
<RuleStateFilter
selectedStates={[]}
onChange={onChangeMock}
/>
);
const wrapper = mountWithIntl(<RuleStateFilter selectedStates={[]} onChange={onChangeMock} />);

expect(wrapper.find('[data-test-subj="ruleStateFilterSelect"]').exists()).toBeFalsy();

Expand All @@ -48,12 +38,7 @@ describe('rule_state_filter', () => {
});

it('can select states', () => {
const wrapper = mountWithIntl(
<RuleStateFilter
selectedStates={[]}
onChange={onChangeMock}
/>
);
const wrapper = mountWithIntl(<RuleStateFilter selectedStates={[]} onChange={onChangeMock} />);

wrapper.find(EuiFilterButton).simulate('click');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import { EuiFilterButton, EuiPopover, EuiFilterGroup, EuiFilterSelectItem } from

type State = 'enabled' | 'muted' | 'disabled';

const states: State[] = [
'enabled',
'disabled',
'muted',
];
const states: State[] = ['enabled', 'disabled', 'muted'];

const optionStyles = {
textTransform: 'capitalize' as const,
Expand All @@ -23,9 +19,9 @@ const optionStyles = {
const getOptionDataTestSubj = (state: State) => `ruleStateFilterOption-${state}`;

export interface RuleStateFilterProps {
selectedStates: State[],
dataTestSubj?: string,
buttonDataTestSubj?: string,
selectedStates: State[];
dataTestSubj?: string;
buttonDataTestSubj?: string;
optionDataTestSubj?: (state: State) => string;
onChange: (selectedStates: State[]) => void;
}
Expand Down

0 comments on commit 31aa11b

Please sign in to comment.