@@ -139,6 +139,48 @@ class ContentExample {
139
139
'<p><span class="silent user-group-mention" data-user-group-id="186">test-empty</span></p>' ,
140
140
const UserMentionNode (nodes: [TextNode ('test-empty' )]));
141
141
142
+ static final channelWildcardMentionPlain = ContentExample .inline (
143
+ 'plain channel wildcard @-mention' ,
144
+ "@**all**" ,
145
+ expectedText: '@all' ,
146
+ '<p><span class="user-mention channel-wildcard-mention" data-user-id="*">@all</span></p>' ,
147
+ const UserMentionNode (nodes: [TextNode ('@all' )]));
148
+
149
+ static final channelWildcardMentionSilent = ContentExample .inline (
150
+ 'silent channel wildcard @-mention' ,
151
+ "@_**everyone**" ,
152
+ expectedText: 'everyone' ,
153
+ '<p><span class="user-mention channel-wildcard-mention silent" data-user-id="*">everyone</span></p>' ,
154
+ const UserMentionNode (nodes: [TextNode ('everyone' )]));
155
+
156
+ static final channelWildcardMentionSilentClassOrderReversed = ContentExample .inline (
157
+ 'silent channel wildcard @-mention, class order reversed' ,
158
+ "@_**channel**" , // (hypothetical server variation)
159
+ expectedText: 'channel' ,
160
+ '<p><span class="silent user-mention channel-wildcard-mention" data-user-id="*">channel</span></p>' ,
161
+ const UserMentionNode (nodes: [TextNode ('channel' )]));
162
+
163
+ static final legacyChannelWildcardMentionPlain = ContentExample .inline (
164
+ 'legacy plain channel wildcard @-mention' ,
165
+ "@**channel**" ,
166
+ expectedText: '@channel' ,
167
+ '<p><span class="user-mention" data-user-id="*">@channel</span></p>' ,
168
+ const UserMentionNode (nodes: [TextNode ('@channel' )]));
169
+
170
+ static final legacyChannelWildcardMentionSilent = ContentExample .inline (
171
+ 'legacy silent channel wildcard @-mention' ,
172
+ "@_**stream**" ,
173
+ expectedText: 'stream' ,
174
+ '<p><span class="user-mention silent" data-user-id="*">stream</span></p>' ,
175
+ const UserMentionNode (nodes: [TextNode ('stream' )]));
176
+
177
+ static final legacyChannelWildcardMentionSilentClassOrderReversed = ContentExample .inline (
178
+ 'legacy silent channel wildcard @-mention, class order reversed' ,
179
+ "@_**all**" , // (hypothetical server variation)
180
+ expectedText: 'all' ,
181
+ '<p><span class="silent user-mention" data-user-id="*">all</span></p>' ,
182
+ const UserMentionNode (nodes: [TextNode ('all' )]));
183
+
142
184
static final emojiUnicode = ContentExample .inline (
143
185
'Unicode emoji, encoded in span element' ,
144
186
":thumbs_up:" ,
@@ -1213,7 +1255,13 @@ void main() {
1213
1255
testParseExample (ContentExample .groupMentionSilent);
1214
1256
testParseExample (ContentExample .groupMentionSilentClassOrderReversed);
1215
1257
1216
- // TODO test wildcard mentions
1258
+ testParseExample (ContentExample .channelWildcardMentionPlain);
1259
+ testParseExample (ContentExample .channelWildcardMentionSilent);
1260
+ testParseExample (ContentExample .channelWildcardMentionSilentClassOrderReversed);
1261
+
1262
+ testParseExample (ContentExample .legacyChannelWildcardMentionPlain);
1263
+ testParseExample (ContentExample .legacyChannelWildcardMentionSilent);
1264
+ testParseExample (ContentExample .legacyChannelWildcardMentionSilentClassOrderReversed);
1217
1265
});
1218
1266
1219
1267
testParseExample (ContentExample .emojiUnicode);
0 commit comments