Pārlūkot izejas kodu

Mention live filter bugfix and add tests for it. updates #212

JC Brand 10 gadi atpakaļ
vecāks
revīzija
ff32866f21
2 mainītis faili ar 15 papildinājumiem un 1 dzēšanām
  1. 1 0
      docs/CHANGES.rst
  2. 14 1
      spec/controlbox.js

+ 1 - 0
docs/CHANGES.rst

@@ -5,6 +5,7 @@ Changelog
 ------------------
 
 * Converse.js now responds to XEP-0030: Service Discovery requests. [jcbrand]
+* #212 Bugfix. Groups weren't being show again after the live filter was cleared. [jcbrand]
 * #215 (and also #75) XEP-0249: Direct MUC Invitations. [jcbrand]
 * #216 Contacts tab empty when using xhr_user_search. [hcderaad and jcbrand]
 

+ 14 - 1
spec/controlbox.js

@@ -179,7 +179,6 @@
                 runs (function () {
                     expect($roster.find('dd:visible').length).toBe(5);
                     expect($roster.find('dt:visible').length).toBe(4);
-
                     $filter.val("xxx");
                     $filter.trigger('keydown');
                 });
@@ -187,6 +186,13 @@
                 runs (function () {
                     expect($roster.find('dd:visible').length).toBe(0);
                     expect($roster.find('dt:visible').length).toBe(0);
+                    $filter.val("");  // Check that contacts are shown again, when the filter string is cleared.
+                    $filter.trigger('keydown');
+                });
+                waits(350); // Needed, due to debounce
+                runs(function () {
+                    expect($roster.find('dd:visible').length).toBe(15);
+                    expect($roster.find('dt:visible').length).toBe(5);
                 });
                 converse.roster_groups = false;
             });
@@ -219,6 +225,13 @@
                 waits(350); // Needed, due to debounce
                 runs (function () {
                     expect($roster.find('dt:visible').length).toBe(0);
+                    $filter.val(""); // Check that groups are shown again, when the filter string is cleared.
+                    $filter.trigger('keydown');
+                });
+                waits(350); // Needed, due to debounce
+                runs(function () {
+                    expect($roster.find('dd:visible').length).toBe(15);
+                    expect($roster.find('dt:visible').length).toBe(5);
                 });
                 converse.roster_groups = false;
             });