Split the Freedompro user flow init from its data (#180745)

This commit is contained in:
Franck Nijhof
2026-08-30 12:21:15 +02:00
committed by GitHub
parent 91e8c7a81b
commit 5bca6514d0
@@ -39,9 +39,15 @@ async def test_invalid_auth(hass: HomeAssistant) -> None:
},
):
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data=VALID_CONFIG,
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input=VALID_CONFIG,
)
assert result["errors"] == {"base": "invalid_auth"}
@@ -57,9 +63,15 @@ async def test_connection_error(hass: HomeAssistant) -> None:
},
):
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data=VALID_CONFIG,
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input=VALID_CONFIG,
)
assert result["errors"] == {"base": "cannot_connect"}
@@ -75,9 +87,15 @@ async def test_create_entry(hass: HomeAssistant) -> None:
},
):
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data=VALID_CONFIG,
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input=VALID_CONFIG,
)
assert result["type"] is FlowResultType.CREATE_ENTRY