Skip to content

Commit

Permalink
chore: Add table migration test
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Nov 20, 2024
1 parent 3f0ade0 commit ff730d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/utils/chart-config/versioning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from "@/config-types";
import { stringifyComponentId } from "@/graphql/make-component-id";
import dualLine1Fixture from "@/test/__fixtures/config/dev/chartConfig-photovoltaik-und-gebaudeprogramm.json";
import tableFixture from "@/test/__fixtures/config/dev/chartConfig-table-covid19.json";
import {
CHART_CONFIG_VERSION,
CONFIGURATOR_STATE_VERSION,
Expand Down Expand Up @@ -195,6 +196,15 @@ describe("config migrations", () => {
})]: "#1f77b4",
});
});

it("should correctly migrate table charts to v4.0.0", async () => {
const migratedConfig = await migrateChartConfig(tableFixture, {
toVersion: "4.0.0",
migrationProps: CONFIGURATOR_STATE,
});
const decodedConfig = decodeChartConfig(migratedConfig);
expect(decodedConfig).toBeDefined();
});
});

describe("last version", () => {
Expand Down

0 comments on commit ff730d9

Please sign in to comment.