Skip to content

Commit

Permalink
Remove unused prop from stale tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rylnd committed Oct 1, 2020
1 parent aa3f9b0 commit 32f292f
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,23 @@ jest.mock('../../../../common/lib/kibana');

describe('EqlQueryBar', () => {
let mockField: EqlQueryBarProps['field'];
let mockIndex: string[];

beforeEach(() => {
mockIndex = ['index-123*'];
mockField = useFormFieldMock({
value: mockQueryBar,
});
});

it('renders correctly', () => {
const wrapper = shallow(
<EqlQueryBar index={mockIndex} dataTestSubj="myQueryBar" field={mockField} />
);
const wrapper = shallow(<EqlQueryBar dataTestSubj="myQueryBar" field={mockField} />);

expect(wrapper.find('[data-test-subj="myQueryBar"]')).toHaveLength(1);
});

it('sets the field value on input change', () => {
const wrapper = mount(
<TestProviders>
<EqlQueryBar index={mockIndex} dataTestSubj="myQueryBar" field={mockField} />
<EqlQueryBar dataTestSubj="myQueryBar" field={mockField} />
</TestProviders>
);

Expand All @@ -59,7 +55,7 @@ describe('EqlQueryBar', () => {
it('does not render errors for a valid query', () => {
const wrapper = mount(
<TestProviders>
<EqlQueryBar index={mockIndex} dataTestSubj="myQueryBar" field={mockField} />
<EqlQueryBar dataTestSubj="myQueryBar" field={mockField} />
</TestProviders>
);

Expand All @@ -75,7 +71,7 @@ describe('EqlQueryBar', () => {
});
const wrapper = mount(
<TestProviders>
<EqlQueryBar index={mockIndex} dataTestSubj="myQueryBar" field={invalidMockField} />
<EqlQueryBar dataTestSubj="myQueryBar" field={invalidMockField} />
</TestProviders>
);

Expand Down

0 comments on commit 32f292f

Please sign in to comment.