SameerMesiah97 commented on code in PR #74127:
URL: https://github.com/apache/airflow/pull/74127#discussion_r4368182032


##########
airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_deadlines.py:
##########
@@ -559,20 +577,53 @@ def test_returns_deadline_alerts_for_dag(self, 
test_client):
         response = test_client.get(f"/dags/{DAG_ID}/deadlineAlerts")
         assert response.status_code == 200
         data = response.json()
-        assert data["total_entries"] == 1
-        assert len(data["deadline_alerts"]) == 1
+        assert data["total_entries"] == 2
+        assert len(data["deadline_alerts"]) == 2
 
     def test_alert_response_fields(self, test_client):
         """Alert response includes expected fields with correct values."""
         response = test_client.get(f"/dags/{DAG_ID}/deadlineAlerts")
+
         assert response.status_code == 200
-        alert = response.json()["deadline_alerts"][0]
+
+        data = response.json()
+        alert = next(alert for alert in data["deadline_alerts"] if 
alert["name"] == ALERT_NAME)
+
         assert alert["name"] == ALERT_NAME
         assert alert["interval"] == 3600.0
         assert alert["reference_type"] == "DagRunQueuedAtDeadline"
         assert "id" in alert
         assert "created_at" in alert
 
+    @pytest.mark.parametrize(
+        ("params", "expected_alerts"),
+        [
+            pytest.param(
+                {"name": ALERT_NAME},
+                [ALERT_NAME],
+                id="matching_name",
+            ),
+            pytest.param(
+                {"name": "does-not-exist"},
+                [],
+                id="no_match",
+            ),
+        ],
+    )
+    def test_filter_by_name(self, test_client, params, expected_alerts):

Review Comment:
   Done..



##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/deadlines.py:
##########


Review Comment:
   Has been changed now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to