Skip to content

Commit

Permalink
✅ update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Sep 5, 2024
1 parent d3d9b8a commit c6f3fbd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions adminSiteServer/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ describe("OwidAdminApp: indicator-level chart configs", () => {
// make a request to create a chart that inherits from the variable
const response = await makeRequestAgainstAdminApi({
method: "POST",
path: "/charts?inheritance=enable",
path: "/charts",
body: JSON.stringify(testChartConfig),
})
const chartId = response.chartId
Expand Down Expand Up @@ -631,7 +631,15 @@ describe("OwidAdminApp: indicator-level chart configs", () => {
expect(parent.variableId).toEqual(variableId)
expect(parent.config).toEqual(fullConfigETL)

// verify that inheritance is disabled by default
// verify that inheritance is enabled by default
await checkInheritance({ shouldBeEnabled: true })

// disable inheritance
await makeRequestAgainstAdminApi({
method: "PUT",
path: `/charts/${chartId}?inheritance=disable`,
body: JSON.stringify(testChartConfig),
})
await checkInheritance({ shouldBeEnabled: false })

// enable inheritance
Expand All @@ -649,14 +657,6 @@ describe("OwidAdminApp: indicator-level chart configs", () => {
body: JSON.stringify(testChartConfig),
})
await checkInheritance({ shouldBeEnabled: true })

// disable inheritance
await makeRequestAgainstAdminApi({
method: "PUT",
path: `/charts/${chartId}?inheritance=disable`,
body: JSON.stringify(testChartConfig),
})
await checkInheritance({ shouldBeEnabled: false })
})

it("should recompute configs when the parent of a chart changes", async () => {
Expand Down

0 comments on commit c6f3fbd

Please sign in to comment.