@@ -404,19 +404,33 @@ void main() {
404404 });
405405
406406 group ('MentionAutocompleteQuery.testUser' , () {
407+ late PerAccountStore store;
408+
407409 void doCheck (String rawQuery, User user, bool expected) {
408410 final result = MentionAutocompleteQuery (rawQuery)
409- .testUser (user, AutocompleteDataCache ());
411+ .testUser (user, AutocompleteDataCache (), store );
410412 expected ? check (result).isTrue () : check (result).isFalse ();
411413 }
412414
413415 test ('user is always excluded when not active regardless of other criteria' , () {
416+ store = eg.store ();
417+
414418 doCheck ('Full Name' , eg.user (fullName: 'Full Name' , isActive: false ), false );
415419 // When active then other criteria will be checked
416420 doCheck ('Full Name' , eg.user (fullName: 'Full Name' , isActive: true ), true );
417421 });
418422
423+ test ('user is always excluded when muted, regardless of other criteria' , () async {
424+ store = eg.store ();
425+ await store.setMutedUsers ([1 ]);
426+ doCheck ('Full Name' , eg.user (userId: 1 , fullName: 'Full Name' ), false );
427+ // When not muted, then other criteria will be checked
428+ doCheck ('Full Name' , eg.user (userId: 2 , fullName: 'Full Name' ), true );
429+ });
430+
419431 test ('user is included if fullname words match the query' , () {
432+ store = eg.store ();
433+
420434 doCheck ('' , eg.user (fullName: 'Full Name' ), true );
421435 doCheck ('' , eg.user (fullName: '' ), true ); // Unlikely case, but should not crash
422436 doCheck ('Full Name' , eg.user (fullName: 'Full Name' ), true );
0 commit comments