Skip to content
Snippets Groups Projects
Unverified Commit c8612597 authored by Erik Montnemery's avatar Erik Montnemery Committed by GitHub
Browse files

Hide inactive repairs issues (#75556)

parent 46551a50
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,7 @@ def ws_list_issues(
issues = [
dataclasses.asdict(issue, dict_factory=ws_dict)
for issue in issue_registry.issues.values()
if issue.active
]
connection.send_result(msg["id"], {"issues": issues})
......
......@@ -9,7 +9,11 @@ import pytest
import voluptuous as vol
from homeassistant import data_entry_flow
from homeassistant.components.repairs import RepairsFlow, async_create_issue
from homeassistant.components.repairs import (
RepairsFlow,
async_create_issue,
issue_registry,
)
from homeassistant.components.repairs.const import DOMAIN
from homeassistant.const import __version__ as ha_version
from homeassistant.core import HomeAssistant
......@@ -366,8 +370,24 @@ async def test_step_unauth(
@freeze_time("2022-07-19 07:53:05")
async def test_list_issues(hass: HomeAssistant, hass_ws_client) -> None:
async def test_list_issues(hass: HomeAssistant, hass_storage, hass_ws_client) -> None:
"""Test we can list issues."""
# Add an inactive issue, this should not be exposed in the list
hass_storage[issue_registry.STORAGE_KEY] = {
"version": issue_registry.STORAGE_VERSION,
"data": {
"issues": [
{
"created": "2022-07-19T09:41:13.746514+00:00",
"dismissed_version": None,
"domain": "test",
"issue_id": "issue_3_inactive",
},
]
},
}
assert await async_setup_component(hass, DOMAIN, {})
client = await hass_ws_client(hass)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment