diff --git a/tests/components/persistent_notification/test_init.py b/tests/components/persistent_notification/test_init.py index 3a5e9ef6b74..4f0851dc477 100644 --- a/tests/components/persistent_notification/test_init.py +++ b/tests/components/persistent_notification/test_init.py @@ -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