From 51af4d4f1911954ff14e905baf728d2ad47fd747 Mon Sep 17 00:00:00 2001 From: Elias Lecomte Date: Wed, 7 Jan 2026 14:44:21 +0100 Subject: [PATCH] Savings: add Belgium and update co2 with 2024 data (#26435) --- assets/js/components/Savings/co2Reference.ts | 39 ++++++++++---------- tests/statistics.spec.ts | 12 +++--- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/assets/js/components/Savings/co2Reference.ts b/assets/js/components/Savings/co2Reference.ts index fa342c786..191dbfecc 100644 --- a/assets/js/components/Savings/co2Reference.ts +++ b/assets/js/components/Savings/co2Reference.ts @@ -1,26 +1,27 @@ -// Data source: gCO2eq/kWh +// Data source: gCO2eq/kWh, current data is from 2024. const source = "https://ourworldindata.org/grapher/carbon-intensity-electricity?tab=table"; // This is a manual selection of countries. If yours is missing, please add it with data from the source above. const regions = [ - { name: "Australia", co2: 503 }, - { name: "Austria", co2: 158 }, - { name: "Canada", co2: 128 }, - { name: "Czech Republic", co2: 415 }, - { name: "Denmark", co2: 181 }, - { name: "Estonia", co2: 464 }, - { name: "Europe", co2: 278 }, - { name: "Finland", co2: 131 }, - { name: "France", co2: 85 }, - { name: "Germany", co2: 385 }, - { name: "Netherlands", co2: 356 }, - { name: "Norway", co2: 29 }, - { name: "Poland", co2: 635 }, - { name: "Sweden", co2: 45 }, - { name: "Switzerland", co2: 46 }, - { name: "United Kingdom", co2: 257 }, - { name: "United States", co2: 367 }, - { name: "World", co2: 436 }, + { name: "Australia", co2: 552 }, + { name: "Austria", co2: 103 }, + { name: "Belgium", co2: 118 }, + { name: "Canada", co2: 175 }, + { name: "Czech Republic", co2: 414 }, + { name: "Denmark", co2: 143 }, + { name: "Estonia", co2: 341 }, + { name: "Europe", co2: 284 }, + { name: "Finland", co2: 72 }, + { name: "France", co2: 44 }, + { name: "Germany", co2: 344 }, + { name: "Netherlands", co2: 253 }, + { name: "Norway", co2: 31 }, + { name: "Poland", co2: 615 }, + { name: "Sweden", co2: 36 }, + { name: "Switzerland", co2: 37 }, + { name: "United Kingdom", co2: 211 }, + { name: "United States", co2: 384 }, + { name: "World", co2: 473 }, ]; export default { regions, source }; diff --git a/tests/statistics.spec.ts b/tests/statistics.spec.ts index 1d0a5b09c..115bf078a 100644 --- a/tests/statistics.spec.ts +++ b/tests/statistics.spec.ts @@ -58,7 +58,7 @@ test.describe("statistics values", async () => { await expect(page.getByTestId("savings-tile-price")).toContainText("6 Fr. saved"); await expect(page.getByTestId("savings-tile-co2")).toContainText("8g/kWh"); - await expect(page.getByTestId("savings-tile-co2")).toContainText("19 kg saved"); + await expect(page.getByTestId("savings-tile-co2")).toContainText("17 kg saved"); }); test("last 365 days", async ({ page }) => { @@ -78,7 +78,7 @@ test.describe("statistics values", async () => { await expect(page.getByTestId("savings-tile-price")).toContainText("6 Fr. saved"); await expect(page.getByTestId("savings-tile-co2")).toContainText("14g/kWh"); - await expect(page.getByTestId("savings-tile-co2")).toContainText("37 kg saved"); + await expect(page.getByTestId("savings-tile-co2")).toContainText("33 kg saved"); }); test("reference data", async ({ page }) => { @@ -88,19 +88,19 @@ test.describe("statistics values", async () => { await expect(page.getByTestId("savings-reference")).toContainText("Reference data:"); await expect(page.getByTestId("savings-reference")).toContainText("30.0 rp/kWh (grid)"); - await expect(page.getByTestId("savings-reference")).toContainText("⌀ 385 g/kWh"); + await expect(page.getByTestId("savings-reference")).toContainText("⌀ 344 g/kWh"); await expect(page.getByTestId("savings-reference")).toContainText("Germany"); - await expect(page.getByTestId("savings-tile-co2")).toContainText("19 kg saved"); + await expect(page.getByTestId("savings-tile-co2")).toContainText("17 kg saved"); await page .getByTestId("savings-region-select") .getByRole("combobox") .selectOption("Switzerland"); - await expect(page.getByTestId("savings-reference")).toContainText("⌀ 46 g/kWh"); + await expect(page.getByTestId("savings-reference")).toContainText("⌀ 37 g/kWh"); await expect(page.getByTestId("savings-reference")).toContainText("Switzerland"); - await expect(page.getByTestId("savings-tile-co2")).toContainText("2 kg saved"); + await expect(page.getByTestId("savings-tile-co2")).toContainText("1 kg saved"); }); });