@remit/ui 0.0.190 → 0.0.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -445,6 +445,16 @@ describe("FilterPreviewCount", () => {
|
|
|
445
445
|
assert.doesNotMatch(html, /role="alert"/);
|
|
446
446
|
});
|
|
447
447
|
|
|
448
|
+
it("does not mark the empty-index line as recounting", () => {
|
|
449
|
+
const html = render(
|
|
450
|
+
createElement(FilterPreviewCount, {
|
|
451
|
+
preview: { status: "ready", count: 0, stale: true, indexEmpty: true },
|
|
452
|
+
}),
|
|
453
|
+
);
|
|
454
|
+
assert.match(html, /Still indexing/);
|
|
455
|
+
assert.doesNotMatch(html, /recounting/);
|
|
456
|
+
});
|
|
457
|
+
|
|
448
458
|
it("counts many matches", () => {
|
|
449
459
|
const html = render(
|
|
450
460
|
createElement(FilterPreviewCount, {
|
|
@@ -230,10 +230,12 @@ export function matchJoinWord(operator: MatchOperator): string {
|
|
|
230
230
|
export function previewCountSummary(preview: PreviewCount): string {
|
|
231
231
|
if (preview.status === "loading") return "Counting matches…";
|
|
232
232
|
if (preview.status === "error") return preview.reason;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
// An index with nothing in it counted nothing, so there is no count to mark
|
|
234
|
+
// as recounting. The sentence is about the index, not about the rule, and it
|
|
235
|
+
// reads the same whichever predicate is on screen.
|
|
236
|
+
if (preview.indexEmpty)
|
|
237
|
+
return "Still indexing — nothing to match against yet";
|
|
238
|
+
if (preview.count === 0) return "No mail matches yet";
|
|
237
239
|
const noun = preview.count === 1 ? "message" : "messages";
|
|
238
240
|
const base = `${preview.count} ${noun} match`;
|
|
239
241
|
return preview.stale ? `${base} — recounting` : base;
|