From 47fad86d7cf714d25b1dd718be4c29382247c607 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 29 Aug 2026 21:01:08 +0200 Subject: [PATCH] Split the Slack user flow init from its data (#180673) --- tests/components/slack/test_config_flow.py | 33 ++++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tests/components/slack/test_config_flow.py b/tests/components/slack/test_config_flow.py index 6d0953da5e97..1c10bf4b575a 100644 --- a/tests/components/slack/test_config_flow.py +++ b/tests/components/slack/test_config_flow.py @@ -54,9 +54,14 @@ async def test_flow_user_invalid_auth( """Test user initialized flow with invalid token.""" mock_connection(aioclient_mock, "invalid_auth") result = await hass.config_entries.flow.async_init( - DOMAIN, - context={"source": config_entries.SOURCE_USER}, - data=CONF_DATA, + 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=CONF_INPUT ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user" @@ -69,9 +74,14 @@ async def test_flow_user_cannot_connect( """Test user initialized flow with unreachable server.""" mock_connection(aioclient_mock, "cannot_connect") result = await hass.config_entries.flow.async_init( - DOMAIN, - context={"source": config_entries.SOURCE_USER}, - data=CONF_DATA, + 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=CONF_INPUT ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user" @@ -85,9 +95,14 @@ async def test_flow_user_unknown_error(hass: HomeAssistant) -> None: ) as mock: mock.side_effect = Exception result = await hass.config_entries.flow.async_init( - DOMAIN, - context={"source": config_entries.SOURCE_USER}, - data=CONF_DATA, + 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=CONF_INPUT ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user"