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