Config UI: fix loadpoint phases (#23170)

This commit is contained in:
Michael Geers 2025-08-22 19:39:29 +02:00 • committed by GitHub
parent 5167700c70
commit 5f92ebd9a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 3 deletions

View file

@ -713,8 +713,8 @@ export default {
},
phasesOptions() {
return [
{ value: "1", name: this.$t("config.loadpoint.phases1p") },
{ value: "3", name: this.$t("config.loadpoint.phases3p") },
{ value: 1, name: this.$t("config.loadpoint.phases1p") },
{ value: 3, name: this.$t("config.loadpoint.phases3p") },
];
},
showCircuit() {

View file

@ -25,7 +25,7 @@ export default defineComponent({
name: "SelectGroup",
props: {
id: String,
options: Array as PropType<SelectOption<string>[]>,
options: Array as PropType<SelectOption<string | number>[]>,
modelValue: [Number, String, Boolean, null],
equalWidth: Boolean,
large: Boolean,

View file

@ -43,7 +43,21 @@ test.describe("charging loadpoint", async () => {
await chargerModal.getByLabel("Charge status").selectOption("C");
await chargerModal.getByLabel("Power").fill("11000");
await chargerModal.getByRole("button", { name: "Save" }).click();
await expectModalHidden(chargerModal);
await expectModalVisible(lpModal);
await expect(lpModal.getByLabel("Title")).toHaveValue("Solar Carport");
// verify defaults
await expect(lpModal.getByLabel("Default mode")).toHaveValue("");
// mode
await expect(lpModal.getByTestId("loadpointSolarMode-default")).toHaveClass(/active/);
await expect(lpModal.getByTestId("loadpointSolarMode-custom")).not.toHaveClass(/active/);
// min/max current
await expect(lpModal.getByTestId("chargerPower-11kw")).toHaveClass(/active/);
await expect(lpModal.getByTestId("chargerPower-22kw")).not.toHaveClass(/active/);
await expect(lpModal.getByTestId("chargerPower-other")).not.toHaveClass(/active/);
// phases
await expect(lpModal.getByTestId("loadpointParamPhases-1")).not.toHaveClass(/active/);
await expect(lpModal.getByTestId("loadpointParamPhases-3")).toHaveClass(/active/);
// create loadpoint
await lpModal.getByRole("button", { name: "Save" }).click();
@ -70,6 +84,7 @@ test.describe("charging loadpoint", async () => {
await expect(lpModal.getByRole("heading", { name: "Edit Charging Point" })).toBeVisible();
await lpModal.getByLabel("Title").fill("Solar Carport 2");
await lpModal.getByRole("button", { name: "Save" }).click();
await expectModalHidden(lpModal);
await expect(page.getByTestId("loadpoint")).toContainText("Solar Carport 2");
// restart