diff --git a/tests/components/dlink/test_config_flow.py b/tests/components/dlink/test_config_flow.py index 6998299c76fa..f3403aafc463 100644 --- a/tests/components/dlink/test_config_flow.py +++ b/tests/components/dlink/test_config_flow.py @@ -45,7 +45,15 @@ async def test_flow_user_already_configured( ) -> None: """Test user initialized flow with duplicate server.""" result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=CONF_DATA + 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_DATA, ) assert result["type"] is FlowResultType.ABORT @@ -60,7 +68,15 @@ async def test_flow_user_cannot_connect( """Test user initialized flow with unreachable server.""" with patch_config_flow(mocked_plug_legacy_no_auth): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=CONF_DATA + 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_DATA, ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user" @@ -83,7 +99,15 @@ async def test_flow_user_unknown_error( with patch_config_flow(mocked_plug) as mock: mock.side_effect = Exception result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER}, data=CONF_DATA + 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_DATA, ) assert result["type"] is FlowResultType.FORM assert result["step_id"] == "user"