mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
* [toasts] get rid of notify globals, refactor messageToasts for use by entire app * [remove notify] use arrow func in ajax call * fix lint + tests * actually fix tests from messageToast refactor * add 'test:one' npm script * debugger * [toasts] convert bootstrap flash messages to toasts in explore + sqllab * [toasts][tests] import from right file
32 lines
931 B
JavaScript
32 lines
931 B
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 '../../../src/SqlLab/components/SqlEditor';
|
|
import SqlEditorLeftBar from '../../../src/SqlLab/components/SqlEditorLeftBar';
|
|
|
|
describe('SqlEditor', () => {
|
|
const mockedProps = {
|
|
actions: {},
|
|
database: {},
|
|
queryEditor: initialState.sqlLab.queryEditors[0],
|
|
latestQuery: queries[0],
|
|
tables: [table],
|
|
queries,
|
|
getHeight: () => ('100px'),
|
|
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);
|
|
});
|
|
});
|