From 4b5930cc0c04a88395b2528d3fc492ca7882a63a Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 29 Aug 2026 20:52:49 +0200 Subject: [PATCH] Split the SleepIQ user flow init from its data (#180666) --- tests/components/sleepiq/test_config_flow.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/components/sleepiq/test_config_flow.py b/tests/components/sleepiq/test_config_flow.py index 26007d42e7da..0b0519bc4778 100644 --- a/tests/components/sleepiq/test_config_flow.py +++ b/tests/components/sleepiq/test_config_flow.py @@ -47,7 +47,7 @@ async def test_show_set_form(hass: HomeAssistant) -> None: """Test that the setup form is served.""" with patch("asyncsleepiq.AsyncSleepIQ.login"): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=None + DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result["type"] is FlowResultType.FORM @@ -68,7 +68,14 @@ async def test_login_failure(hass: HomeAssistant, side_effect, error) -> None: side_effect=side_effect, ): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=SLEEPIQ_CONFIG + DOMAIN, context={"source": config_entries.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=SLEEPIQ_CONFIG ) assert result["type"] is FlowResultType.FORM