@@ -2624,6 +2624,51 @@ def test__handle_reaction_event_for_msg_in_index(
2624
2624
def update_message_flags_operation (self , request ):
2625
2625
return request .param
2626
2626
2627
+ @pytest .mark .parametrize (
2628
+ "event,initial_alerted_words, expected_alert_words" ,
2629
+ [
2630
+ (
2631
+ {"type" : "alert_words" , "alert_words" : ["word1" , "word2" , "word3" ]},
2632
+ ["word1" ],
2633
+ ["word1" , "word2" , "word3" ],
2634
+ ),
2635
+ (
2636
+ {"type" : "alert_words" , "alert_words" : []},
2637
+ ["word1" ],
2638
+ [],
2639
+ ),
2640
+ (
2641
+ {"type" : "alert_words" , "alert_words" : ["word1" , "word4" ]},
2642
+ ["word1" ],
2643
+ ["word1" , "word4" ],
2644
+ ),
2645
+ (
2646
+ {"type" : "alert_words" , "alert_words" : ["word1" , "word2" ]},
2647
+ ["word1" , "word2" , "word3" ],
2648
+ ["word1" , "word2" ],
2649
+ ),
2650
+ (
2651
+ {"type" : "alert_words" , "alert_words" : ["word1" , "word3" ]},
2652
+ ["word1" , "word2" ],
2653
+ ["word1" , "word3" ],
2654
+ ),
2655
+ ],
2656
+ ids = [
2657
+ "Add multiple alert words" ,
2658
+ "Empty alert words" ,
2659
+ "Add single new alert words" ,
2660
+ "Delete an alert word" ,
2661
+ "Add and delete alert words" ,
2662
+ ],
2663
+ )
2664
+ def test__handle_alert_words_event (
2665
+ self , mocker , model , event , initial_alerted_words , expected_alert_words
2666
+ ):
2667
+ model ._handle_alert_words_event (event )
2668
+
2669
+ assert model ._alert_words != initial_alerted_words
2670
+ assert model ._alert_words == expected_alert_words
2671
+
2627
2672
def test_update_star_status_no_index (
2628
2673
self , mocker , model , update_message_flags_operation
2629
2674
):
0 commit comments