Battery UI: 100% buffersoc resets bufferstart (#29669)
This commit is contained in:
parent
f5ce6e78bb
commit
d4d8109a63
2 changed files with 9 additions and 2 deletions
|
|
@ -379,7 +379,9 @@ export default defineComponent({
|
|||
},
|
||||
async changeBufferSoc($event: Event) {
|
||||
const soc = parseInt(($event.target as HTMLInputElement).value, 10);
|
||||
if (soc > this.bufferStartSoc && this.bufferStartSoc > 0) {
|
||||
if (soc === 100) {
|
||||
await this.setBufferStartSoc(0);
|
||||
} else if (soc > this.bufferStartSoc && this.bufferStartSoc > 0) {
|
||||
await this.setBufferStartSoc(soc);
|
||||
}
|
||||
await this.saveBufferSoc(soc);
|
||||
|
|
|
|||
|
|
@ -38,16 +38,21 @@ test.describe("battery settings", async () => {
|
|||
|
||||
const topRow = page.getByText("Battery-supported vehicle charging");
|
||||
const bufferSoc = topRow.getByRole("combobox").filter({ hasText: "disabled" });
|
||||
const bufferStart = page.locator("#batterySettingsBufferStart");
|
||||
|
||||
await expect(bufferSoc).toHaveValue("100");
|
||||
await expect(page.getByText("Start automatically")).toBeHidden();
|
||||
|
||||
await bufferSoc.selectOption({ label: "when above 80%" });
|
||||
await expect(bufferSoc).toHaveValue("80");
|
||||
await expect(page.getByText("Start automatically")).toBeVisible();
|
||||
|
||||
await bufferStart.selectOption({ label: "when above 90%." });
|
||||
|
||||
await bufferSoc.selectOption({ label: "disabled" });
|
||||
await expect(page.getByText("Start automatically")).toBeHidden();
|
||||
|
||||
await bufferSoc.selectOption({ label: "when above 80%" });
|
||||
await expect(topRow).toContainText("only with enough surplus.");
|
||||
});
|
||||
|
||||
test("grid charging", async ({ page }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue