Grid charge: fix 0 cost limit (#29817)

This commit is contained in:
Michael Geers 2026-05-11 10:30:36 +02:00 • committed by GitHub
parent ffcc99db3a
commit 207fa7984c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -10,7 +10,7 @@
> >
<div class="container"> <div class="container">
<SmartCostLimit <SmartCostLimit
:current-limit="loadpoint?.smartCostLimit || null" :current-limit="loadpoint?.smartCostLimit ?? null"
:last-limit="loadpoint?.lastSmartCostLimit" :last-limit="loadpoint?.lastSmartCostLimit"
:smart-cost-type="smartCostType" :smart-cost-type="smartCostType"
:currency="currency" :currency="currency"
@ -22,7 +22,7 @@
class="mt-2 mb-4" class="mt-2 mb-4"
/> />
<SmartFeedInPriority <SmartFeedInPriority
:current-limit="loadpoint?.smartFeedInPriorityLimit || null" :current-limit="loadpoint?.smartFeedInPriorityLimit ?? null"
:last-limit="loadpoint?.lastSmartFeedInPriorityLimit" :last-limit="loadpoint?.lastSmartFeedInPriorityLimit"
:currency="currency" :currency="currency"
:loadpoint-id="id" :loadpoint-id="id"

View file

@ -55,11 +55,18 @@ test.describe("smart cost limit", async () => {
const modal = page.getByTestId("loadpoint-settings-modal"); const modal = page.getByTestId("loadpoint-settings-modal");
await expectModalVisible(modal); await expectModalVisible(modal);
await modal.getByLabel("Enable limit").check(); await modal.getByLabel("Enable limit").check();
await modal.getByLabel("Price limit").selectOption("≤ 10.0 ct/kWh"); await modal.getByLabel("Price limit").selectOption("≤ 0.0 ct/kWh");
await expect(modal.getByTestId("active-hours")).toHaveText("Active time"); await expect(modal.getByTestId("active-hours")).toHaveText("Active time");
await modal.getByLabel("Close").click(); await modal.getByLabel("Close").click();
await expectModalHidden(modal); await expectModalHidden(modal);
await expect(page.getByTestId("vehicle-status-charger")).toHaveText("Charging…"); await expect(page.getByTestId("vehicle-status-charger")).toHaveText("Charging…");
await expect(page.getByTestId("vehicle-status-smartcost")).toHaveText("≤ 10.0 ct"); await expect(page.getByTestId("vehicle-status-smartcost")).toHaveText("≤ 0.0 ct");
// Reload to force a fresh mount of the loadpoint components
await page.reload();
await page.getByTestId("loadpoint-settings-button").nth(1).click();
await expectModalVisible(modal);
await expect(modal.getByLabel("Enable limit")).toBeChecked();
await expect(modal.getByLabel("Price limit")).toContainText("≤ 0.0 ct/kWh");
}); });
}); });