diff --git a/frontend_tests/node_tests/filter.js b/frontend_tests/node_tests/filter.js index eda55ed0b4..7583acd9c5 100644 --- a/frontend_tests/node_tests/filter.js +++ b/frontend_tests/node_tests/filter.js @@ -1478,6 +1478,9 @@ test("navbar_helpers", () => { const group_pm_including_missing_person = [ {operator: "pm-with", operand: "joe@example.com,STEVE@foo.com,sally@doesnotexist.com"}, ]; + // not common narrows, but used for browser title updates + const is_alerted = [{operator: "is", operand: "alerted"}]; + const is_unread = [{operator: "is", operand: "unread"}]; const test_cases = [ { @@ -1598,6 +1601,20 @@ test("navbar_helpers", () => { ]), redirect_url_with_search: "/#narrow/pm-with/undefined", }, + { + operator: is_alerted, + is_common_narrow: false, + icon: undefined, + title: "translated: Alerted messages", + redirect_url_with_search: "#", + }, + { + operator: is_unread, + is_common_narrow: false, + icon: undefined, + title: "translated: Unread messages", + redirect_url_with_search: "#", + }, ]; for (const test_case of test_cases) { diff --git a/static/js/filter.js b/static/js/filter.js index ccc83320f1..ffb7e5c500 100644 --- a/static/js/filter.js +++ b/static/js/filter.js @@ -706,6 +706,13 @@ export class Filter { } case "is-resolved": return $t({defaultMessage: "Topics marked as resolved"}); + // These cases return false for is_common_narrow, and therefore are not + // formatted in the message view header. They are used in narrow.js to + // update the browser title. + case "is-alerted": + return $t({defaultMessage: "Alerted messages"}); + case "is-unread": + return $t({defaultMessage: "Unread messages"}); } } /* istanbul ignore next */