diff --git a/tests/components/brunt/test_config_flow.py b/tests/components/brunt/test_config_flow.py index 7a805a9ee523..5a1bfd17efd9 100644 --- a/tests/components/brunt/test_config_flow.py +++ b/tests/components/brunt/test_config_flow.py @@ -22,7 +22,15 @@ pytestmark = pytest.mark.usefixtures("mock_setup_entry") async def test_form(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None: """Test we get the form.""" 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 + assert result["step_id"] == "user" + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input=None, ) assert result["type"] is FlowResultType.FORM assert result["errors"] is None @@ -57,7 +65,15 @@ async def test_form_duplicate_login(hass: HomeAssistant) -> None: return_value=None, ): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=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=CONFIG, ) assert result["type"] is FlowResultType.ABORT assert result["reason"] == "already_configured" @@ -79,7 +95,15 @@ async def test_form_error(hass: HomeAssistant, side_effect, error_message) -> No side_effect=side_effect, ): result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=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=CONFIG, ) assert result["type"] is FlowResultType.FORM