Skip to content

Commit

Permalink
Remove deprecated hass.components from frontend tests (home-assista…
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbede authored Mar 22, 2024
1 parent c282172 commit 08529b3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/components/frontend/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
DOMAIN,
EVENT_PANELS_UPDATED,
THEMES_STORAGE_KEY,
async_register_built_in_panel,
async_remove_panel,
)
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -417,8 +419,8 @@ async def test_get_panels(
resp = await mock_http_client.get("/map")
assert resp.status == HTTPStatus.NOT_FOUND

hass.components.frontend.async_register_built_in_panel(
"map", "Map", "mdi:tooltip-account", require_admin=True
async_register_built_in_panel(
hass, "map", "Map", "mdi:tooltip-account", require_admin=True
)

resp = await mock_http_client.get("/map")
Expand All @@ -440,7 +442,7 @@ async def test_get_panels(
assert msg["result"]["map"]["title"] == "Map"
assert msg["result"]["map"]["require_admin"] is True

hass.components.frontend.async_remove_panel("map")
async_remove_panel(hass, "map")

resp = await mock_http_client.get("/map")
assert resp.status == HTTPStatus.NOT_FOUND
Expand All @@ -454,12 +456,10 @@ async def test_get_panels_non_admin(
"""Test get_panels command."""
hass_admin_user.groups = []

hass.components.frontend.async_register_built_in_panel(
"map", "Map", "mdi:tooltip-account", require_admin=True
)
hass.components.frontend.async_register_built_in_panel(
"history", "History", "mdi:history"
async_register_built_in_panel(
hass, "map", "Map", "mdi:tooltip-account", require_admin=True
)
async_register_built_in_panel(hass, "history", "History", "mdi:history")

await ws_client.send_json({"id": 5, "type": "get_panels"})

Expand Down

0 comments on commit 08529b3

Please sign in to comment.