From 915d135c66fae570217ee569ce3270573cf736ef Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 29 Aug 2026 21:16:53 +0200 Subject: [PATCH] Split the PoolSense user flow init from its data (#180685) --- .../components/poolsense/test_config_flow.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/components/poolsense/test_config_flow.py b/tests/components/poolsense/test_config_flow.py index 4e160a3cd9fb..7ea37b2f8168 100644 --- a/tests/components/poolsense/test_config_flow.py +++ b/tests/components/poolsense/test_config_flow.py @@ -47,9 +47,15 @@ async def test_invalid_credentials( """Test we handle invalid credentials.""" mock_poolsense_client.test_poolsense_credentials.return_value = False result = await hass.config_entries.flow.async_init( - DOMAIN, - context={"source": SOURCE_USER}, - data={CONF_EMAIL: "test@test.com", CONF_PASSWORD: "test"}, + DOMAIN, context={"source": 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_EMAIL: "test@test.com", CONF_PASSWORD: "test"}, ) assert result["type"] is FlowResultType.FORM @@ -73,9 +79,15 @@ async def test_duplicate_entry( """Test we can't add the same entry twice.""" mock_config_entry.add_to_hass(hass) result = await hass.config_entries.flow.async_init( - DOMAIN, - context={"source": SOURCE_USER}, - data={CONF_EMAIL: "test@test.com", CONF_PASSWORD: "test"}, + DOMAIN, context={"source": 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_EMAIL: "test@test.com", CONF_PASSWORD: "test"}, ) await hass.async_block_till_done()