// (C) 2007-2019 GoodData Corporation import { buildProject } from "../../builder"; import { schema } from "../../fixtures/dummySchema"; it("should create metrics", () => { expect(buildProject(schema).groups[0].metrics).toEqual([ { content: { expression: "SELECT 1", format: "#,##0.00", }, meta: { category: "metric", identifier: "simple_metric", title: "Simple metric", uri: "/gdc/md/mockproject/obj/simple_metric", }, }, { content: { expression: "SELECT 2", format: "#,##0.00", }, meta: { category: "metric", identifier: "4321", title: "Simple metric 2", uri: "/gdc/md/mockproject/obj/4321", }, }, { content: { expression: "SELECT 1", format: "#,##0.00", }, meta: { category: "metric", identifier: "default_metric", title: "Default metric", uri: "/gdc/md/mockproject/obj/default_metric", }, }, { content: { expression: "SELECT 1", format: "#0", }, meta: { category: "metric", identifier: "metric_with_format", tags: undefined, title: "Metric with format", uri: "/gdc/md/mockproject/obj/metric_with_format", }, }, { content: { expression: "SELECT 1", format: "#,##0.00", }, meta: { category: "metric", identifier: "too_large", tags: undefined, title: "non computable metric", uri: "/gdc/md/mockproject/obj/too_large", }, }, { content: { expression: "SELECT 1", format: "#,##0.00", }, meta: { category: "metric", identifier: "savedm_1", tags: undefined, title: "# of Opportunities", uri: "/gdc/md/mockproject/obj/savedm_1", }, }, ]); });