Skip to content
Snippets Groups Projects
Unverified Commit 0ecb5b08 authored by Aleksandr Lesnenko's avatar Aleksandr Lesnenko Committed by GitHub
Browse files

allow description columns to be dimensions of charts (#42539)

parent 47148ce7
No related branches found
No related tags found
No related merge requests found
......@@ -111,8 +111,7 @@ export const isScope = isFieldType.bind(null, SCOPE);
export const isCategory = isFieldType.bind(null, CATEGORY);
export const isLocation = isFieldType.bind(null, LOCATION);
export const isDimension = col =>
col && col.source !== "aggregation" && !isDescription(col);
export const isDimension = col => col && col.source !== "aggregation";
export const isMetric = col =>
col && col.source !== "breakout" && isSummable(col);
......
......@@ -13,9 +13,25 @@ import {
getFieldType,
isString,
isInteger,
isDimension,
} from "metabase-lib/v1/types/utils/isa";
import { createMockColumn } from "metabase-types/api/mocks";
describe("isa", () => {
describe("isDimension", () => {
it("should should return false for aggregation columns", () => {
expect(isDimension(createMockColumn({ source: "aggregation" }))).toBe(
false,
);
});
it("should should return true for description column types", () => {
expect(
isDimension(createMockColumn({ semantic_type: TYPE.Description })),
).toBe(true);
});
});
describe("getFieldType", () => {
it("should know a date", () => {
expect(getFieldType({ base_type: TYPE.Date })).toEqual(TEMPORAL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment