@@ -24,6 +24,7 @@ import RoomHeaderButtons from "../../../../src/components/views/right_panel/Room
2424import { MatrixClientPeg } from "../../../../src/MatrixClientPeg" ;
2525import SettingsStore from "../../../../src/settings/SettingsStore" ;
2626import { stubClient } from "../../../test-utils" ;
27+ import { mkThread } from "../../../test-utils/threads" ;
2728
2829describe ( "RoomHeaderButtons-test.tsx" , function ( ) {
2930 const ROOM_ID = "!roomId:example.org" ;
@@ -52,7 +53,7 @@ describe("RoomHeaderButtons-test.tsx", function () {
5253 return container . querySelector ( ".mx_RightPanel_threadsButton" ) ;
5354 }
5455
55- function isIndicatorOfType ( container , type : "red" | "gray" ) {
56+ function isIndicatorOfType ( container , type : "red" | "gray" | "bold" ) {
5657 return container . querySelector ( ".mx_RightPanel_threadsButton .mx_Indicator" ) . className . includes ( type ) ;
5758 }
5859
@@ -76,7 +77,7 @@ describe("RoomHeaderButtons-test.tsx", function () {
7677 expect ( container . querySelector ( ".mx_RightPanel_threadsButton .mx_Indicator" ) ) . toBeNull ( ) ;
7778 } ) ;
7879
79- it ( "room wide notification does not change the thread button" , ( ) => {
80+ it ( "thread notification does change the thread button" , ( ) => {
8081 const { container } = getComponent ( room ) ;
8182
8283 room . setThreadUnreadNotificationCount ( "$123" , NotificationCountType . Total , 1 ) ;
@@ -89,6 +90,10 @@ describe("RoomHeaderButtons-test.tsx", function () {
8990 room . setThreadUnreadNotificationCount ( "$123" , NotificationCountType . Highlight , 0 ) ;
9091
9192 expect ( container . querySelector ( ".mx_RightPanel_threadsButton .mx_Indicator" ) ) . toBeNull ( ) ;
93+
94+ // Thread activity should appear on the icon.
95+ mkThread ( { room, client, authorId : client . getUserId ( ) ! , participantUserIds : [ "@alice:example.org" ] } ) ;
96+ expect ( isIndicatorOfType ( getComponent ( room ) , "bold" ) ) . toBe ( true ) ;
9297 } ) ;
9398
9499 it ( "does not explode without a room" , ( ) => {
0 commit comments