From f77629d0f8f9ffd78eb834885ed09809cd3384ea Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Wed, 26 Nov 2025 00:06:48 +0200 Subject: [PATCH] Add coverage for Shelly repairs (#157277) --- tests/components/shelly/test_repairs.py | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/components/shelly/test_repairs.py b/tests/components/shelly/test_repairs.py index cec37142e05..b0aae87c875 100644 --- a/tests/components/shelly/test_repairs.py +++ b/tests/components/shelly/test_repairs.py @@ -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"