Skip to content

Commit 1e71da3

Browse files
committed
test: failing repro for empty title on unknown alert types
1 parent d34ffe3 commit 1e71da3

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/core/test_package_and_alerts.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,24 @@ def test_gpt_did_you_mean_gets_typosquat_title(self, core):
186186
assert alert.title, "title should not be empty for gptDidYouMean"
187187
assert "typosquat" in alert.title.lower()
188188

189+
def test_unknown_alert_type_falls_back_to_humanized_title(self, core):
190+
"""Any alert type not present in the SDK should still render a non-empty title."""
191+
package = self.make_package(
192+
alerts=[{
193+
"type": "someBrandNewAlertType",
194+
"key": "future-alert",
195+
"severity": "low",
196+
}],
197+
topLevelAncestors=[],
198+
)
199+
200+
result = core.add_package_alerts_to_collection(
201+
package, alerts_collection={}, packages={package.id: package}
202+
)
203+
204+
alert = result["future-alert"][0]
205+
assert alert.title == "Some Brand New Alert Type"
206+
189207

190208

191209
def test_get_capabilities_for_added_packages(self, core):

0 commit comments

Comments
 (0)