Skip to content

Commit

Permalink
test: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Jun 11, 2024
1 parent 6f21786 commit 8b3a5fa
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/@ourworldindata/grapher/src/core/EntityUrlBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Url } from "@ourworldindata/utils"
import {
ENTITY_V2_DELIMITER,
getSelectedEntityNamesParam,
migrateSelectedEntityNamesParam,
setSelectedEntityNamesParam,
} from "./EntityUrlBuilder"

Expand Down Expand Up @@ -74,7 +75,9 @@ encodeTests.forEach((testCase) => {
it(`correctly decodes url strings`, () => {
expect(
getSelectedEntityNamesParam(
Url.fromQueryStr(testCase.inputQueryStr)
migrateSelectedEntityNamesParam(
Url.fromQueryStr(testCase.inputQueryStr)
)
)
).toEqual(testCase.entities)
})
Expand All @@ -99,7 +102,11 @@ describe("legacyLinks", () => {
legacyLinks.forEach((testCase) => {
it(`correctly decodes legacy url strings`, () => {
expect(
getSelectedEntityNamesParam(Url.fromQueryStr(testCase.queryStr))
getSelectedEntityNamesParam(
migrateSelectedEntityNamesParam(
Url.fromQueryStr(testCase.queryStr)
)
)
).toEqual(testCase.entities)
})
})
Expand Down Expand Up @@ -133,7 +140,9 @@ describe("it can handle legacy urls with dimension in selection key", () => {
].join(ENTITY_V2_DELIMITER),
})

const results = getSelectedEntityNamesParam(url)
const results = getSelectedEntityNamesParam(
migrateSelectedEntityNamesParam(url)
)

expect(results).toEqual([
"United States",
Expand Down

0 comments on commit 8b3a5fa

Please sign in to comment.