@@ -885,6 +885,8 @@ def test_toggle_stream_muted_status(
885
885
(["read" ], "add" ),
886
886
(["read" , "starred" ], "remove" ),
887
887
(["starred" , "read" ], "remove" ),
888
+ (["read" , "mentioned" , "wildcard_mentioned" ], "add" ),
889
+ (["mentioned" , "wildcard_mentioned" , "starred" ], "remove" ),
888
890
],
889
891
)
890
892
def test_toggle_message_star_status (
@@ -2075,11 +2077,18 @@ def test_update_star_status_invalid_operation(
2075
2077
("add" , 1 , ["read" ], ["read" , "starred" ]),
2076
2078
("add" , 1 , ["starred" ], ["starred" ]),
2077
2079
("add" , 1 , ["read" , "starred" ], ["read" , "starred" ]),
2080
+ ("add" , 1 , ["mentioned" ], ["mentioned" , "starred" ]),
2081
+ ("add" , 1 , ["mentioned" , "starred" ], ["mentioned" , "starred" ]),
2082
+ ("add" , 1 , ["wildcard_mentioned" ], ["wildcard_mentioned" , "starred" ]),
2078
2083
("remove" , - 1 , [], []),
2079
2084
("remove" , - 1 , ["read" ], ["read" ]),
2080
2085
("remove" , - 1 , ["starred" ], []),
2081
2086
("remove" , - 1 , ["read" , "starred" ], ["read" ]),
2082
2087
("remove" , - 1 , ["starred" , "read" ], ["read" ]),
2088
+ ("remove" , - 1 , ["mentioned" ], ["mentioned" ]),
2089
+ ("remove" , - 1 , ["wildcard_mentioned" ], ["wildcard_mentioned" ]),
2090
+ ("remove" , - 1 , ["mentioned" , "starred" ], ["mentioned" ]),
2091
+ ("remove" , - 1 , ["wildcard_mentioned" , "starred" ], ["wildcard_mentioned" ]),
2083
2092
],
2084
2093
)
2085
2094
def test_update_star_status (
@@ -2098,7 +2107,23 @@ def test_update_star_status(
2098
2107
2099
2108
model .index = dict (
2100
2109
messages = {msg_id : {"flags" : flags_before } for msg_id in indexed_ids },
2101
- unread_mentioned_msg_ids = set (),
2110
+ mentioned_msg_ids = set (
2111
+ [
2112
+ msg_id
2113
+ for msg_id in indexed_ids
2114
+ if {"mentioned" , "wildcard_mentioned" } & set (flags_before )
2115
+ ]
2116
+ ),
2117
+ unread_mentioned_msg_ids = set (
2118
+ [
2119
+ msg_id
2120
+ for msg_id in indexed_ids
2121
+ if (
2122
+ {"mentioned" , "wildcard_mentioned" } & set (flags_before )
2123
+ and "read" not in flags_before
2124
+ )
2125
+ ]
2126
+ ),
2102
2127
starred_msg_ids = set (
2103
2128
[msg_id for msg_id in indexed_ids if "starred" in flags_before ]
2104
2129
),
@@ -2159,11 +2184,19 @@ def test_update_star_status(
2159
2184
("add" , ["read" ], ["read" ]),
2160
2185
("add" , ["starred" ], ["starred" , "read" ]),
2161
2186
("add" , ["read" , "starred" ], ["read" , "starred" ]),
2187
+ ("add" , ["mentioned" ], ["mentioned" , "read" ]),
2188
+ ("add" , ["read" , "mentioned" ], ["read" , "mentioned" ]),
2189
+ ("add" , ["mentioned" , "starred" ], ["mentioned" , "starred" , "read" ]),
2190
+ ("add" , ["wildcard_mentioned" ], ["wildcard_mentioned" , "read" ]),
2162
2191
("remove" , [], []),
2163
2192
("remove" , ["read" ], ["read" ]), # msg cannot be marked 'unread'
2164
2193
("remove" , ["starred" ], ["starred" ]),
2194
+ ("remove" , ["mentioned" ], ["mentioned" ]),
2165
2195
("remove" , ["starred" , "read" ], ["starred" , "read" ]),
2166
2196
("remove" , ["read" , "starred" ], ["read" , "starred" ]),
2197
+ ("remove" , ["read" , "mentioned" ], ["read" , "mentioned" ]),
2198
+ ("remove" , ["wildcard_mentioned" ], ["wildcard_mentioned" ]),
2199
+ ("remove" , ["read" , "wildcard_mentioned" ], ["read" , "wildcard_mentioned" ]),
2167
2200
],
2168
2201
)
2169
2202
def test_update_read_status (
0 commit comments