mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Verify persistant notifications can be dismissed by the id they are created with (#94112)
This commit is contained in:
parent
6ab7b0f99c
commit
001da39a47
@ -151,3 +151,27 @@ async def test_ws_get_subscribe(
|
||||
assert msg["event"]
|
||||
event = msg["event"]
|
||||
assert event["type"] == "removed"
|
||||
|
||||
|
||||
async def test_manual_notification_id_round_trip(hass: HomeAssistant) -> None:
|
||||
"""Test that a manual notification id can be round tripped."""
|
||||
notifications = pn._async_get_or_create_notifications(hass)
|
||||
assert len(notifications) == 0
|
||||
|
||||
await hass.services.async_call(
|
||||
pn.DOMAIN,
|
||||
"create",
|
||||
{"notification_id": "synology_diskstation_hub_notification", "message": "test"},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
assert len(notifications) == 1
|
||||
|
||||
await hass.services.async_call(
|
||||
pn.DOMAIN,
|
||||
"dismiss",
|
||||
{"notification_id": "synology_diskstation_hub_notification"},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
assert len(notifications) == 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user