Split user flow init and data submission in airvisual config flow tests (#183653)

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
Manu
2026-09-30 08:21:15 +02:00
committed by GitHub
co-authored by epenet
parent 1948f87d94
commit c87c0f04ff
@@ -86,8 +86,8 @@ async def test_create_entry(
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}, data={"type": integration_type}
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input={"type": integration_type}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == input_form_step
@@ -109,7 +109,8 @@ async def test_create_entry(
assert result["data"] == {**config, CONF_INTEGRATION_TYPE: integration_type}
async def test_duplicate_error(hass: HomeAssistant, config, setup_config_entry) -> None:
@pytest.mark.usefixtures("setup_config_entry")
async def test_duplicate_error(hass: HomeAssistant, config) -> None:
"""Test that errors are shown when duplicate entries are added."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
@@ -117,10 +118,8 @@ async def test_duplicate_error(hass: HomeAssistant, config, setup_config_entry)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={"type": INTEGRATION_TYPE_GEOGRAPHY_COORDS},
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input={"type": INTEGRATION_TYPE_GEOGRAPHY_COORDS}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "geography_by_coords"