mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 19:00:09 -04:00
* Migrate table editor to React: skeleton, Grid tab * Columns tab * Cleanup * Columns tab: DnD column sorting * Columns types should be JSX * New Columns tab UI/X * Use Sortable component on Columns tab * Tests: Grid Settings * Tests: Columns Settings * Tests: Editors for Text, Number, Boolean and Date/Time columns * Tests: Editors for Image and Link columns * Minor UI fix * Trigger build * Debounce inputs
37 lines
931 B
JavaScript
37 lines
931 B
JavaScript
import React from 'react';
|
|
import enzyme from 'enzyme';
|
|
|
|
import getOptions from '../getOptions';
|
|
import GridSettings from './GridSettings';
|
|
|
|
function findByTestID(wrapper, testId) {
|
|
return wrapper.find(`[data-test="${testId}"]`);
|
|
}
|
|
|
|
function mount(options, done) {
|
|
const data = { columns: [], rows: [] };
|
|
options = getOptions(options, data);
|
|
return enzyme.mount((
|
|
<GridSettings
|
|
visualizationName="Test"
|
|
data={data}
|
|
options={options}
|
|
onOptionsChange={(changedOptions) => {
|
|
expect(changedOptions).toMatchSnapshot();
|
|
done();
|
|
}}
|
|
/>
|
|
));
|
|
}
|
|
|
|
describe('Visualizations -> Table -> Editor -> Grid Settings', () => {
|
|
test('Changes items per page', (done) => {
|
|
const el = mount({
|
|
itemsPerPage: 25,
|
|
}, done);
|
|
|
|
findByTestID(el, 'Table.ItemsPerPage').first().simulate('click');
|
|
findByTestID(el, 'Table.ItemsPerPage.100').first().simulate('click');
|
|
});
|
|
});
|