fleet/frontend/components/Queries/NewQuery/NewQuery.tests.jsx
Mike Stone 23ffa5be62 Query side panel (#269)
* QuerySidePanel component

* Adds all osquery table names to ace editor mode

* kolide theme for strings

* Detect OS from browser

* Show utility and specs availability as 'All Platforms'

* Show column description as alt text
2016-10-11 11:32:39 -04:00

52 lines
1.2 KiB
JavaScript

import React from 'react';
import expect, { restoreSpies } from 'expect';
import { mount } from 'enzyme';
import { noop } from 'lodash';
import { createAceSpy } from '../../../test/helpers';
import NewQuery from './index';
describe('NewQuery - component', () => {
beforeEach(() => {
createAceSpy();
});
afterEach(restoreSpies);
it('renders the SaveQuerySection', () => {
const component = mount(
<NewQuery
onOsqueryTableSelect={noop}
onTextEditorInputChange={noop}
textEditorText="Hello world"
/>
);
expect(component.find('SaveQuerySection').length).toEqual(1);
});
it('renders the ThemeDropdown', () => {
const component = mount(
<NewQuery
onOsqueryTableSelect={noop}
onTextEditorInputChange={noop}
textEditorText="Hello world"
/>
);
expect(component.find('ThemeDropdown').length).toEqual(1);
});
it('renders the SaveQueryForm', () => {
const component = mount(
<NewQuery
onOsqueryTableSelect={noop}
onTextEditorInputChange={noop}
textEditorText="Hello world"
/>
);
component.find('Slider').simulate('click');
expect(component.find('SaveQueryForm').length).toEqual(1);
});
});