@@ -345,52 +345,6 @@ def test_query_filter_by_action(self) -> None:
345345 assert len (response3 .data ) == 2
346346 assert {self .workflow .name , self .workflow_two .name } == {w ["name" ] for w in response3 .data }
347347
348- def test_sort_by_last_triggered_with_non_single_written_only (self ) -> None :
349- workflow_never_fired = self .create_workflow (
350- organization_id = self .organization .id , name = "Never Fired"
351- )
352-
353- workflow_with_history = self .create_workflow (
354- organization_id = self .organization .id , name = "With History"
355- )
356- WorkflowFireHistory .objects .create (
357- workflow = workflow_with_history ,
358- group = self .group ,
359- event_id = self .event .event_id ,
360- )
361-
362- # Test ascending order (lastTriggered)
363- response = self .get_success_response (
364- self .organization .slug , qs_params = {"sortBy" : "lastTriggered" }
365- )
366-
367- # Workflows without history should come first, then those with it
368- expected_ascending_order = [
369- self .workflow_three .name ,
370- workflow_never_fired .name ,
371- self .workflow .name ,
372- self .workflow_two .name ,
373- workflow_with_history .name ,
374- ]
375-
376- assert [w ["name" ] for w in response .data ] == expected_ascending_order
377-
378- # Test descending order (-lastTriggered)
379- response_desc = self .get_success_response (
380- self .organization .slug , qs_params = {"sortBy" : "-lastTriggered" }
381- )
382-
383- # In descending order, workflows with history should come first
384- expected_descending_order = [
385- workflow_with_history .name ,
386- self .workflow_two .name ,
387- self .workflow .name ,
388- workflow_never_fired .name ,
389- self .workflow_three .name ,
390- ]
391-
392- assert [w ["name" ] for w in response_desc .data ] == expected_descending_order
393-
394348 def test_compound_query (self ) -> None :
395349 self .create_detector_workflow (
396350 workflow = self .workflow , detector = self .create_detector (project = self .project )
0 commit comments