Skip to content

Commit

Permalink
fix: Test
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Nov 21, 2023
1 parent 10d1af8 commit 9c5f2bc
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions app/charts/shared/use-sync-interactive-filters.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { fireEvent, render } from "@testing-library/react";
import merge from "lodash/merge";
import { useState } from "react";

import useSyncInteractiveFilters from "@/charts/shared/use-sync-interactive-filters";
Expand Down Expand Up @@ -94,14 +93,23 @@ const setup = ({
describe("useSyncInteractiveFilters", () => {
it("should keep interactive filters in sync with values from chart config", async () => {
const { getIFState, clickUseModified } = setup({
modifiedChartConfig: merge({}, chartConfig, {
filters: {
"http://environment.ld.admin.ch/foen/px/0703010000_103/dimension/1": {
value:
"http://environment.ld.admin.ch/foen/px/0703010000_103/dimension/1/1",
modifiedChartConfig: {
...chartConfig,
cubes: [
{
...chartConfig.cubes[0],
filters: {
...chartConfig.cubes[0].filters,
"http://environment.ld.admin.ch/foen/px/0703010000_103/dimension/1":
{
type: "single",
value:
"http://environment.ld.admin.ch/foen/px/0703010000_103/dimension/1/1",
},
},
},
},
}),
],
},
});

// interactive filters are initialized correctly
Expand Down

0 comments on commit 9c5f2bc

Please sign in to comment.