Split user flow init and data submission in surepetcare config flow tests (#184099)

This commit is contained in:
Manu
2026-10-03 10:33:35 +02:00
committed by GitHub
parent 4e0c9dcae4
commit 203763cd20
@@ -129,15 +129,21 @@ async def test_flow_entry_already_exists(
unique_id="test-username",
)
first_entry.add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_USER},
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
assert result["errors"] == {}
with patch(
"homeassistant.components.surepetcare.async_setup_entry",
return_value=True,
):
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_USER},
data={
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
user_input={
"username": "test-username",
"password": "test-password",
},