Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ada-x64 committed Feb 12, 2024
1 parent 4662fc4 commit 19f10e6
Show file tree
Hide file tree
Showing 11 changed files with 181 additions and 158 deletions.
11 changes: 2 additions & 9 deletions packages/perspective-viewer-d3fc/test/js/barWidth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

import { test, expect } from "@finos/perspective-test";
import { test, expect, DEFAULT_CONFIG } from "@finos/perspective-test";
import {
API_VERSION,
compareSVGContentsToSnapshot,
Expand Down Expand Up @@ -41,19 +41,12 @@ test.describe("Bar Width", () => {
);

expect(config).toEqual({
version: API_VERSION,
...DEFAULT_CONFIG,
plugin: "Y Bar",
columns: ["Profit"],
group_by: ["Order Date"],
split_by: ["Profit"],
aggregates: {},
filter: [],
sort: [],
plugin_config: {},
settings: false,
expressions: {},
theme: "Pro Light",
title: null,
});

await compareSVGContentsToSnapshot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ test.describe("Column Style Tests", () => {
await viewer.restore({
plugin: "Datagrid",
columns: ["Row ID", "Sales"],
plugin_config: {
columns: {
Sales: { number_bg_mode: "pulse" },
column_config: {
Sales: {
datagrid_number_style: { number_bg_mode: "pulse" },
},
},
});
Expand Down Expand Up @@ -190,9 +190,9 @@ test.describe("Column Style Tests", () => {
plugin: "Datagrid",
columns: ["Row ID", "Sales"],
settings: true,
plugin_config: {
columns: {
Sales: { number_bg_mode: "pulse" },
column_config: {
Sales: {
datagrid_number_style: { number_bg_mode: "pulse" },
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const TESTS = [
table: "superstore",
title: "One",
plugin: "Y Area",
column_config: {},
plugin_config: {},
group_by: ["bucket(\"Order Date\", 'M')"],
split_by: ["Ship Mode"],
Expand Down
4 changes: 2 additions & 2 deletions rust/perspective-viewer/src/ts/column_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export type PerspectiveColumnConfig = {

export type PerspectiveColumnConfigValue = {
datagrid_number_style?: {
number_fg_mode?: "color" | "bar";
number_bg_mode?: "color" | "gradient" | "pulse";
number_fg_mode?: "color" | "bar" | "disabled";
number_bg_mode?: "color" | "gradient" | "pulse" | "disabled";
fixed?: number;
pos_fg_color?: string;
neg_fg_color?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ test.describe("Regressions", function () {
const token = await view.save();
test.expect(token.column_config).toEqual({
"Row ID": {
integer: {
styles: {
fixed: 4,
},
datagrid_number_style: {
fixed: 4,
},
},
});
Expand Down
Loading

0 comments on commit 19f10e6

Please sign in to comment.