mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Split user flow init and data submission in flipr tests (#179690)
This commit is contained in:
@@ -26,7 +26,14 @@ async def test_full_flow(hass: HomeAssistant, mock_flipr_client: AsyncMock) -> N
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_USER},
|
||||
data={
|
||||
)
|
||||
|
||||
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_EMAIL: "dummylogin",
|
||||
CONF_PASSWORD: "dummypass",
|
||||
},
|
||||
@@ -63,7 +70,14 @@ async def test_errors(
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_USER},
|
||||
data={
|
||||
)
|
||||
|
||||
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_EMAIL: "nada",
|
||||
CONF_PASSWORD: "nadap",
|
||||
},
|
||||
@@ -102,11 +116,19 @@ async def test_no_flipr_found(
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_USER},
|
||||
data={
|
||||
)
|
||||
|
||||
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_EMAIL: "nada",
|
||||
CONF_PASSWORD: "nadap",
|
||||
},
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "user"
|
||||
assert result["errors"] == {"base": "no_flipr_id_found"}
|
||||
@@ -117,7 +139,14 @@ async def test_no_flipr_found(
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_USER},
|
||||
data={
|
||||
)
|
||||
|
||||
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_EMAIL: "dummylogin",
|
||||
CONF_PASSWORD: "dummypass",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user