mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
* Update to the version of react-ace with the fixed sizing issues * Make ace editor resizable * Use small util method for offset calculation instead of $ * Test ResizableAceEditor * Make the right pane of the Sql Lab scrollable * Add default and min height to the ResizableAceEditor * Implement SplitPane * Make Splitter fullscreen * React on resize of the window * Implement min and max * Get rid of a magic number + add margin * Handle resize event with delay + cleanup the code * Make ResultSet adjustable * Make QueryHistory adjustable * Remove ResizableAceEditor * Make linter happy * Test SplitPane * Init sizes properly
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { describe, it } from 'mocha';
|
|
import { expect } from 'chai';
|
|
|
|
import { initialState, queries, table } from './fixtures';
|
|
import SqlEditor from '../../../javascripts/SqlLab/components/SqlEditor';
|
|
import SqlEditorLeftBar from '../../../javascripts/SqlLab/components/SqlEditorLeftBar';
|
|
import SplitPane from '../../../javascripts/SqlLab/components/SplitPane';
|
|
|
|
describe('SqlEditor', () => {
|
|
const mockedProps = {
|
|
actions: {},
|
|
database: {},
|
|
queryEditor: initialState.queryEditors[0],
|
|
latestQuery: queries[0],
|
|
tables: [table],
|
|
queries,
|
|
height: '',
|
|
editorQueries: [],
|
|
dataPreviewQueries: [],
|
|
};
|
|
it('is valid', () => {
|
|
expect(
|
|
React.isValidElement(<SqlEditor {...mockedProps} />),
|
|
).to.equal(true);
|
|
});
|
|
it('render a SqlEditorLeftBar', () => {
|
|
const wrapper = shallow(<SqlEditor {...mockedProps} />);
|
|
expect(wrapper.find(SqlEditorLeftBar)).to.have.length(1);
|
|
});
|
|
it('render a SplitPane', () => {
|
|
const wrapper = shallow(<SqlEditor {...mockedProps} />);
|
|
expect(wrapper.find(SplitPane)).to.have.length(1);
|
|
});
|
|
});
|