mirror of
https://github.com/home-assistant/core.git
synced 2025-08-16 19:11:42 +02:00
Verify persistant notifications can be dismissed by the id they are created with (#94112)
This commit is contained in:
committed by
Paulus Schoutsen
parent
286de1f051
commit
0e50baf007
@@ -212,3 +212,27 @@ async def test_ws_get_subscribe(
|
|||||||
assert msg["event"]
|
assert msg["event"]
|
||||||
event = msg["event"]
|
event = msg["event"]
|
||||||
assert event["type"] == "removed"
|
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
|
||||||
|
Reference in New Issue
Block a user