From 7e3d87a146e8196e9b5540ab593b7b5c410e8129 Mon Sep 17 00:00:00 2001
From: Dave T <17680170+davet2001@users.noreply.github.com>
Date: Fri, 18 Feb 2022 08:05:38 +0000
Subject: [PATCH] Increase helpers.frame test coverage (#65137)

Co-authored-by: Erik Montnemery <erik@montnemery.com>
---
 tests/helpers/test_frame.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/helpers/test_frame.py b/tests/helpers/test_frame.py
index 37f3e7ec95f..936940869d6 100644
--- a/tests/helpers/test_frame.py
+++ b/tests/helpers/test_frame.py
@@ -92,3 +92,16 @@ async def test_prevent_flooding(caplog):
     assert what not in caplog.text
     assert key in frame._REPORTED_INTEGRATIONS
     assert len(frame._REPORTED_INTEGRATIONS) == 1
+
+
+async def test_report_missing_integration_frame(caplog):
+    """Test reporting when no integration is detected."""
+
+    what = "teststring"
+    with patch(
+        "homeassistant.helpers.frame.get_integration_frame",
+        side_effect=frame.MissingIntegrationFrame,
+    ):
+        frame.report(what, error_if_core=False)
+        assert what in caplog.text
+        assert caplog.text.count(what) == 1
-- 
GitLab