@@ -85,6 +85,45 @@ test.describe("Room list", () => {
85
85
await expect ( roomItem ) . not . toBeVisible ( ) ;
86
86
} ) ;
87
87
88
+ test ( "should open the notification options menu" , { tag : "@screenshot" } , async ( { page, app, user } ) => {
89
+ const roomListView = getRoomList ( page ) ;
90
+
91
+ await app . client . createRoom ( { name : "silent" } ) ;
92
+
93
+ const roomItem = roomListView . getByRole ( "gridcell" , { name : "silent" } ) ;
94
+ await roomItem . hover ( ) ;
95
+
96
+ await expect ( roomItem ) . toMatchScreenshot ( "room-list-item-hover.png" ) ;
97
+ let roomItemMenu = roomItem . getByRole ( "button" , { name : "Notification options" } ) ;
98
+ await roomItemMenu . click ( ) ;
99
+
100
+ // Default settings should be selected
101
+ await expect ( page . getByRole ( "menuitem" , { name : "Match default settings" } ) ) . toHaveAttribute (
102
+ "aria-selected" ,
103
+ "true" ,
104
+ ) ;
105
+ await expect ( page ) . toMatchScreenshot ( "room-list-item-open-notification-options.png" ) ;
106
+
107
+ // It should make the room muted
108
+ await page . getByRole ( "menuitem" , { name : "Mute room" } ) . click ( ) ;
109
+
110
+ // Remove hover on the room list item
111
+ await roomListView . hover ( ) ;
112
+
113
+ // The room decoration should have the muted icon
114
+ await expect ( roomItem . getByTestId ( "notification-decoration" ) ) . toBeVisible ( ) ;
115
+
116
+ await roomItem . hover ( ) ;
117
+ // On hover, the room should show the muted icon
118
+ await expect ( roomItem ) . toMatchScreenshot ( "room-list-item-hover-silent.png" ) ;
119
+
120
+ roomItemMenu = roomItem . getByRole ( "button" , { name : "Notification options" } ) ;
121
+ await roomItemMenu . click ( ) ;
122
+ // The Mute room option should be selected
123
+ await expect ( page . getByRole ( "menuitem" , { name : "Mute room" } ) ) . toHaveAttribute ( "aria-selected" , "true" ) ;
124
+ await expect ( page ) . toMatchScreenshot ( "room-list-item-open-notification-options-selection.png" ) ;
125
+ } ) ;
126
+
88
127
test ( "should scroll to the current room" , async ( { page, app, user } ) => {
89
128
const roomListView = getRoomList ( page ) ;
90
129
await roomListView . hover ( ) ;
0 commit comments