diff --git a/tests/components/met/test_config_flow.py b/tests/components/met/test_config_flow.py index 152fbdd2cf57..48c21e73bb0b 100644 --- a/tests/components/met/test_config_flow.py +++ b/tests/components/met/test_config_flow.py @@ -72,7 +72,11 @@ async def test_create_entry(hass: HomeAssistant) -> None: } result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=test_data + DOMAIN, context={"source": config_entries.SOURCE_USER} + ) + assert result["type"] is FlowResultType.FORM + result = await hass.config_entries.flow.async_configure( + result["flow_id"], user_input=test_data ) assert result["type"] is FlowResultType.CREATE_ENTRY @@ -86,9 +90,15 @@ async def test_flow_entry_already_exists(hass: HomeAssistant) -> None: Test when the form should show when user puts existing location in the config gui. Then the form should show with error. """ + # Coordinates as the flow stores them: the schema validates them as floats. first_entry = MockConfigEntry( domain=DOMAIN, - data={"name": "home", CONF_LATITUDE: 0, CONF_LONGITUDE: 0, CONF_ELEVATION: 0}, + data={ + "name": "home", + CONF_LATITUDE: 0.0, + CONF_LONGITUDE: 0.0, + CONF_ELEVATION: 0, + }, ) first_entry.add_to_hass(hass) @@ -100,7 +110,11 @@ async def test_flow_entry_already_exists(hass: HomeAssistant) -> None: } result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER}, data=test_data + DOMAIN, context={"source": config_entries.SOURCE_USER} + ) + assert result["type"] is FlowResultType.FORM + result = await hass.config_entries.flow.async_configure( + result["flow_id"], user_input=test_data ) assert result["type"] is FlowResultType.FORM