From 203763cd20d7c8c2b6d4884a601cc3c99860b3fd Mon Sep 17 00:00:00 2001 From: Manu Date: Sat, 3 Oct 2026 10:33:35 +0200 Subject: [PATCH] Split user flow init and data submission in surepetcare config flow tests (#184099) --- tests/components/surepetcare/test_config_flow.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/components/surepetcare/test_config_flow.py b/tests/components/surepetcare/test_config_flow.py index 4d70a3f0c97c..b6cf0ff90c9b 100644 --- a/tests/components/surepetcare/test_config_flow.py +++ b/tests/components/surepetcare/test_config_flow.py @@ -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", },