FIX: Include liked_consolidated and reaction types in the likes tab unread count (#21198)
This commit is contained in:
parent
24ec06ff85
commit
2bcbabc087
|
@ -63,7 +63,11 @@ const CORE_TOP_TABS = [
|
||||||
}
|
}
|
||||||
|
|
||||||
get count() {
|
get count() {
|
||||||
return this.getUnreadCountForType("liked");
|
return (
|
||||||
|
this.getUnreadCountForType("liked") +
|
||||||
|
this.getUnreadCountForType("liked_consolidated") +
|
||||||
|
this.getUnreadCountForType("reaction")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(osama): reaction is a type used by the reactions plugin, but it's
|
// TODO(osama): reaction is a type used by the reactions plugin, but it's
|
||||||
|
|
|
@ -303,4 +303,23 @@ module("Integration | Component | user-menu", function (hooks) {
|
||||||
);
|
);
|
||||||
assert.strictEqual(queryAll("#quick-access-review-queue ul li").length, 8);
|
assert.strictEqual(queryAll("#quick-access-review-queue ul li").length, 8);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("count on the likes tab", async function (assert) {
|
||||||
|
this.currentUser.set("grouped_unread_notifications", {
|
||||||
|
[NOTIFICATION_TYPES.liked]: 1,
|
||||||
|
[NOTIFICATION_TYPES.liked_consolidated]: 2,
|
||||||
|
[NOTIFICATION_TYPES.reaction]: 3,
|
||||||
|
[NOTIFICATION_TYPES.bookmark_reminder]: 10,
|
||||||
|
});
|
||||||
|
await render(template);
|
||||||
|
|
||||||
|
const likesCountBadge = query(
|
||||||
|
"#user-menu-button-likes .badge-notification"
|
||||||
|
);
|
||||||
|
assert.strictEqual(
|
||||||
|
likesCountBadge.textContent,
|
||||||
|
(1 + 2 + 3).toString(),
|
||||||
|
"combines unread counts for `liked`, `liked_consolidated` and `reaction` types"
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue