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
65 lines
2.7 KiB
JavaScript
65 lines
2.7 KiB
JavaScript
/* eslint-disable global-require, import/no-unresolved */
|
|
import prepareLayout from "./prepareLayout";
|
|
|
|
const fakeElement = { offsetWidth: 400, offsetHeight: 300 };
|
|
|
|
describe("Visualizations", () => {
|
|
describe("Chart", () => {
|
|
describe("prepareLayout", () => {
|
|
test("Pie", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/pie");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Pie without annotations", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/pie-without-annotations");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Pie with multiple series", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/pie-multiple-series");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Box with single Y axis", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/box-single-axis");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Box with second Y axis", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/box-with-second-axis");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Default with single Y axis", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/default-single-axis");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Default with second Y axis", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/default-with-second-axis");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Default without legend", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/default-without-legend");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
|
|
test("Default with stacking", () => {
|
|
const { input, output } = require("./fixtures/prepareLayout/default-with-stacking");
|
|
const layout = prepareLayout(fakeElement, input.options, input.series);
|
|
expect(layout).toEqual(output.layout);
|
|
});
|
|
});
|
|
});
|
|
});
|