@@ -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" ;
@@ -55,7 +56,7 @@ describe("RoomHeaderButtons-test.tsx", function() {
5556 return container . querySelector ( ".mx_RightPanel_threadsButton" ) ;
5657 }
5758
58- function isIndicatorOfType ( container , type : "red" | "gray" ) {
59+ function isIndicatorOfType ( container , type : "red" | "gray" | "bold" ) {
5960 return container . querySelector ( ".mx_RightPanel_threadsButton .mx_Indicator" )
6061 . className
6162 . includes ( type ) ;
@@ -81,7 +82,7 @@ describe("RoomHeaderButtons-test.tsx", function() {
8182 expect ( container . querySelector ( ".mx_RightPanel_threadsButton .mx_Indicator" ) ) . toBeNull ( ) ;
8283 } ) ;
8384
84- it ( "room wide notification does not change the thread button", ( ) => {
85+ it . only ( "thread notification does change the thread button", ( ) => {
8586 const { container } = getComponent ( room ) ;
8687
8788 room . setThreadUnreadNotificationCount ( "$123" , NotificationCountType . Total , 1 ) ;
@@ -94,6 +95,10 @@ describe("RoomHeaderButtons-test.tsx", function() {
9495 room . setThreadUnreadNotificationCount ( "$123" , NotificationCountType . Highlight , 0 ) ;
9596
9697 expect ( container . querySelector ( ".mx_RightPanel_threadsButton .mx_Indicator" ) ) . toBeNull ( ) ;
98+
99+ // Thread activity should appear on the icon.
100+ mkThread ( { room, client, authorId : client . getUserId ( ) ! , participantUserIds : [ "@alice:example.org" ] } ) ;
101+ expect ( isIndicatorOfType ( getComponent ( room ) , "bold" ) ) . toBe ( true ) ;
97102 } ) ;
98103
99104 it ( "does not explode without a room" , ( ) => {
0 commit comments