mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 17:49:37 +01:00
Add coverage for Shelly repairs (#157277)
This commit is contained in:
@@ -459,3 +459,44 @@ async def test_open_wifi_ap_issue_ignore(
|
||||
assert mock_rpc_device.wifi_setconfig.call_count == 0
|
||||
|
||||
assert issue_registry.async_get_issue(DOMAIN, issue_id).dismissed_version
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ignore_missing_translations", ["component.shelly.issues.other_issue.title"]
|
||||
)
|
||||
async def test_other_fixable_issues(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
mock_rpc_device: Mock,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
) -> None:
|
||||
"""Test fixing another issue."""
|
||||
issue_id = "other_issue"
|
||||
assert await async_setup_component(hass, "repairs", {})
|
||||
await hass.async_block_till_done()
|
||||
entry = await init_integration(hass, 2)
|
||||
assert mock_rpc_device.initialized is True
|
||||
|
||||
ir.async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
issue_id,
|
||||
data={"entry_id": entry.entry_id},
|
||||
is_fixable=True,
|
||||
severity=ir.IssueSeverity.ERROR,
|
||||
translation_key="other_issue",
|
||||
)
|
||||
|
||||
assert issue_registry.async_get_issue(DOMAIN, issue_id)
|
||||
assert len(issue_registry.issues) == 1
|
||||
|
||||
await async_process_repairs_platforms(hass)
|
||||
client = await hass_client()
|
||||
result = await start_repair_fix_flow(client, DOMAIN, issue_id)
|
||||
|
||||
flow_id = result["flow_id"]
|
||||
assert result["step_id"] == "confirm"
|
||||
assert result["type"] == "form"
|
||||
|
||||
result = await process_repair_fix_flow(client, flow_id)
|
||||
assert result["type"] == "create_entry"
|
||||
|
||||
Reference in New Issue
Block a user