mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 10:00:17 -04:00
* Prettier all the JS files * Add GitHub Action to autoformat code pushed to master * Fix eslint violation due to formatting. * Remove GitHub actions for styling * Add restyled.io config
44 lines
973 B
JavaScript
44 lines
973 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")
|
|
.last()
|
|
.simulate("click");
|
|
findByTestID(el, "Table.ItemsPerPage.100")
|
|
.last()
|
|
.simulate("click");
|
|
});
|
|
});
|