mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* 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
52 lines
1.2 KiB
JavaScript
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);
|
|
});
|
|
});
|
|
|