Savings: add Belgium and update co2 with 2024 data (#26435)

This commit is contained in:
Elias Lecomte 2026-01-07 14:44:21 +01:00 • committed by GitHub
parent f37484985a
commit 51af4d4f19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 25 deletions

View file

@ -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 };

View file

@ -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");
});
});