Split user flow init and data submission in flipr tests (#179690)

This commit is contained in:
cnico
2026-08-21 07:20:05 +02:00
committed by GitHub
parent e9737b7271
commit 1045ed3566
+33 -4
View File
@@ -26,7 +26,14 @@ async def test_full_flow(hass: HomeAssistant, mock_flipr_client: AsyncMock) -> N
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={
CONF_EMAIL: "dummylogin",
CONF_PASSWORD: "dummypass",
},
@@ -63,7 +70,14 @@ async def test_errors(
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={
CONF_EMAIL: "nada",
CONF_PASSWORD: "nadap",
},
@@ -102,11 +116,19 @@ async def test_no_flipr_found(
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={
CONF_EMAIL: "nada",
CONF_PASSWORD: "nadap",
},
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
assert result["errors"] == {"base": "no_flipr_id_found"}
@@ -117,7 +139,14 @@ async def test_no_flipr_found(
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={
CONF_EMAIL: "dummylogin",
CONF_PASSWORD: "dummypass",
},