mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Fix inkbird config flow tests to correctly test discovery and user flow (#75638)
* Fix inkbird config flow tests to correctly test discovery and user flow * Fix inkbird config flow tests to correctly test discovery and user flow
This commit is contained in:
parent
5b555066ea
commit
88b9a51811
@ -141,12 +141,24 @@ async def test_async_step_user_takes_precedence_over_discovery(hass):
|
||||
assert result["step_id"] == "bluetooth_confirm"
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.sensorpush.async_setup_entry", return_value=True
|
||||
"homeassistant.components.inkbird.config_flow.async_discovered_service_info",
|
||||
return_value=[SPS_SERVICE_INFO],
|
||||
):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_USER},
|
||||
)
|
||||
assert result["type"] == FlowResultType.FORM
|
||||
|
||||
with patch("homeassistant.components.inkbird.async_setup_entry", return_value=True):
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"], user_input={}
|
||||
result["flow_id"],
|
||||
user_input={"address": "61DE521B-F0BF-9F44-64D4-75BBE1738105"},
|
||||
)
|
||||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "IBS-TH 75BBE1738105"
|
||||
assert result2["data"] == {}
|
||||
assert result2["result"].unique_id == "61DE521B-F0BF-9F44-64D4-75BBE1738105"
|
||||
|
||||
# Verify the original one was aborted
|
||||
assert not hass.config_entries.flow.async_progress(DOMAIN)
|
||||
|
Loading…
x
Reference in New Issue
Block a user