diff --git a/tests/components/litejet/test_config_flow.py b/tests/components/litejet/test_config_flow.py index 7b8fa481b697..53c5ba556778 100644 --- a/tests/components/litejet/test_config_flow.py +++ b/tests/components/litejet/test_config_flow.py @@ -28,7 +28,15 @@ async def test_create_entry(hass: HomeAssistant, mock_litejet) -> None: test_data = {CONF_PORT: "/dev/test"} 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 + assert result["step_id"] == "user" + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input=test_data, ) assert result["type"] is FlowResultType.CREATE_ENTRY @@ -44,10 +52,8 @@ async def test_flow_entry_already_exists(hass: HomeAssistant) -> None: ) first_entry.add_to_hass(hass) - test_data = {CONF_PORT: "/dev/test"} - 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.ABORT @@ -62,7 +68,15 @@ async def test_flow_open_failed(hass: HomeAssistant) -> None: mock_pylitejet.side_effect = SerialException 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 + assert result["step_id"] == "user" + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + user_input=test_data, ) assert result["type"] is FlowResultType.FORM