mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08:00
FIX: present correct new/unread counts when filtered by tag
Previously we would incorrectly ignore tags. This ensures tracking state is properly shipped to client if show_filter_by_tag is enabled.
This commit is contained in:
@ -175,7 +175,10 @@ QUnit.test("getSubCategoryIds", assert => {
|
||||
|
||||
QUnit.test("countNew", assert => {
|
||||
const store = createStore();
|
||||
const foo = store.createRecord("category", { id: 1, slug: "foo" });
|
||||
const foo = store.createRecord("category", {
|
||||
id: 1,
|
||||
slug: "foo"
|
||||
});
|
||||
const bar = store.createRecord("category", {
|
||||
id: 2,
|
||||
slug: "bar",
|
||||
@ -202,6 +205,7 @@ QUnit.test("countNew", assert => {
|
||||
};
|
||||
|
||||
assert.equal(state.countNew(1), 1);
|
||||
assert.equal(state.countNew(1, "missing-tag"), 0);
|
||||
assert.equal(state.countNew(2), 1);
|
||||
assert.equal(state.countNew(3), 0);
|
||||
|
||||
@ -209,12 +213,15 @@ QUnit.test("countNew", assert => {
|
||||
last_read_post_number: null,
|
||||
id: 113,
|
||||
notification_level: NotificationLevels.TRACKING,
|
||||
category_id: 3
|
||||
category_id: 3,
|
||||
tags: ["amazing"]
|
||||
};
|
||||
|
||||
assert.equal(state.countNew(1), 2);
|
||||
assert.equal(state.countNew(2), 2);
|
||||
assert.equal(state.countNew(3), 1);
|
||||
assert.equal(state.countNew(3, "amazing"), 1);
|
||||
assert.equal(state.countNew(3, "missing"), 0);
|
||||
|
||||
state.states["t111"] = {
|
||||
last_read_post_number: null,
|
||||
|
Reference in New Issue
Block a user