Skip to content

Commit

Permalink
fix: Test mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Feb 23, 2024
1 parent f2074af commit 1e8de01
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/charts/chart-config-ui-options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jest.mock("rdf-cube-view-query", () => ({
},
}));

jest.mock("../rdf/extended-cube", () => ({
ExtendedCube: jest.fn(),
}));

describe("defaultSegmentOnChange", () => {
it("should not modify filters if selected values are empty", () => {
const filters = { iri: { type: "single", value: "value" } };
Expand Down
4 changes: 4 additions & 0 deletions app/charts/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import {
getPossibleChartTypes,
} from "./index";

jest.mock("../rdf/extended-cube", () => ({
ExtendedCube: jest.fn(),
}));

RDFCubeViewQueryMock;

describe("initial config", () => {
Expand Down
4 changes: 4 additions & 0 deletions app/charts/shared/chart-helpers.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jest.mock("rdf-cube-view-query", () => ({
},
}));

jest.mock("../../rdf/extended-cube", () => ({
ExtendedCube: jest.fn(),
}));

const makeCubeNsGetters = (cubeIri: string) => ({
col: (col: string) => `${cubeIri}/dimension/${col}`,
val: (col: string, n: string) => `${cubeIri}/dimension/${col}/${n}`,
Expand Down
4 changes: 4 additions & 0 deletions app/configurator/components/field.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jest.mock("rdf-cube-view-query", () => ({
},
}));

jest.mock("../../rdf/extended-cube", () => ({
ExtendedCube: jest.fn(),
}));

describe("TimeInput", () => {
const expectedValue = "2020-05-24";
const setup = ({ isOptional, id }: { isOptional: boolean; id: string }) => {
Expand Down
4 changes: 4 additions & 0 deletions app/configurator/components/filters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { getTimeFilterOptions } from "./filters";

RDFCubeViewQueryMock;

jest.mock("../../rdf/extended-cube", () => ({
ExtendedCube: jest.fn(),
}));

describe("TimeFilter", () => {
const dimension = {
timeFormat: "%Y",
Expand Down
4 changes: 4 additions & 0 deletions app/configurator/configurator-state.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jest.mock("rdf-cube-view-query", () => ({
},
}));

jest.mock("../rdf/extended-cube", () => ({
ExtendedCube: jest.fn(),
}));

jest.mock("@/utils/chart-config/api", () => ({
fetchChartConfig: jest.fn(),
}));
Expand Down

0 comments on commit 1e8de01

Please sign in to comment.