@@ -147,7 +147,10 @@ describe("Timeline", () => {
147147 } ) ;
148148 } ) ;
149149
150- describe ( "message displaying" , ( ) => {
150+ describe ( "configure room" , ( ) => {
151+ // Exclude timestamp and read marker from snapshots
152+ const percyCSS = ".mx_MessageTimestamp, .mx_RoomView_myReadMarker { visibility: hidden !important; }" ;
153+
151154 beforeEach ( ( ) => {
152155 cy . injectAxe ( ) ;
153156 } ) ;
@@ -182,6 +185,65 @@ describe("Timeline", () => {
182185 cy . get ( ".mx_MainSplit" ) . percySnapshotElement ( "Configured room on IRC layout" ) ;
183186 } ) ;
184187
188+ it ( "should have an expanded generic event list summary (GELS) on IRC layout" , ( ) => {
189+ cy . visit ( "/#/room/" + roomId ) ;
190+ cy . setSettingValue ( "layout" , null , SettingLevel . DEVICE , Layout . IRC ) ;
191+
192+ // Wait until configuration is finished
193+ cy . contains (
194+ ".mx_RoomView_body .mx_GenericEventListSummary .mx_GenericEventListSummary_summary" ,
195+ "created and configured the room." ,
196+ ) . should ( "exist" ) ;
197+
198+ // Click "expand" link button
199+ cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) . click ( ) ;
200+
201+ // Make sure the "expand" link button worked
202+ cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=true]" ) . should ( "exist" ) ;
203+
204+ // Check the height of expanded GELS line
205+ cy . get ( ".mx_GenericEventListSummary[data-layout=irc] .mx_GenericEventListSummary_spacer" ) . should (
206+ "have.css" ,
207+ "line-height" ,
208+ "18px" , // $irc-line-height: $font-18px (See: _IRCLayout.pcss)
209+ ) ;
210+
211+ cy . get ( ".mx_MainSplit" ) . percySnapshotElement ( "Expanded GELS on IRC layout" , { percyCSS } ) ;
212+ } ) ;
213+
214+ it ( "should have an expanded generic event list summary (GELS) on compact modern/group layout" , ( ) => {
215+ cy . visit ( "/#/room/" + roomId ) ;
216+
217+ // Set compact modern layout
218+ cy . setSettingValue ( "layout" , null , SettingLevel . DEVICE , Layout . Group ) . setSettingValue (
219+ "useCompactLayout" ,
220+ null ,
221+ SettingLevel . DEVICE ,
222+ true ,
223+ ) ;
224+
225+ // Wait until configuration is finished
226+ cy . contains (
227+ ".mx_RoomView_body .mx_GenericEventListSummary .mx_GenericEventListSummary_summary" ,
228+ "created and configured the room." ,
229+ ) . should ( "exist" ) ;
230+
231+ // Click "expand" link button
232+ cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) . click ( ) ;
233+
234+ // Make sure the "expand" link button worked
235+ cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=true]" ) . should ( "exist" ) ;
236+
237+ // Check the height of expanded GELS line
238+ cy . get ( ".mx_GenericEventListSummary[data-layout=group] .mx_GenericEventListSummary_spacer" ) . should (
239+ "have.css" ,
240+ "line-height" ,
241+ "22px" , // $font-22px (See: _GenericEventListSummary.pcss)
242+ ) ;
243+
244+ cy . get ( ".mx_MainSplit" ) . percySnapshotElement ( "Expanded GELS on modern layout" , { percyCSS } ) ;
245+ } ) ;
246+
185247 it ( "should add inline start margin to an event line on IRC layout" , ( ) => {
186248 cy . visit ( "/#/room/" + roomId ) ;
187249 cy . setSettingValue ( "layout" , null , SettingLevel . DEVICE , Layout . IRC ) ;
@@ -212,6 +274,12 @@ describe("Timeline", () => {
212274 } ) ;
213275 cy . checkA11y ( ) ;
214276 } ) ;
277+ } ) ;
278+
279+ describe ( "message displaying" , ( ) => {
280+ beforeEach ( ( ) => {
281+ cy . injectAxe ( ) ;
282+ } ) ;
215283
216284 it ( "should align generic event list summary with messages and emote on IRC layout" , ( ) => {
217285 // This test aims to check:
@@ -569,12 +637,29 @@ describe("Timeline", () => {
569637 // Click "expand" link button
570638 cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) . click ( ) ;
571639
640+ // Make sure the "expand" link button worked
641+ cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=true]" ) . should ( "exist" ) ;
642+
643+ // Make sure spacer is not visible on bubble layout
644+ cy . get ( ".mx_GenericEventListSummary[data-layout=bubble] .mx_GenericEventListSummary_spacer" ) . should (
645+ "not.be.visible" , // See: _GenericEventListSummary.pcss
646+ ) ;
647+
648+ // Exclude timestamp from snapshot
649+ const percyCSS = ".mx_MessageTimestamp { visibility: hidden !important; }" ;
650+
651+ // Save snapshot of expanded generic event list summary on bubble layout
652+ cy . get ( ".mx_MainSplit" ) . percySnapshotElement ( "Expanded GELS on bubble layout" , { percyCSS } ) ;
653+
572654 // Click "collapse" link button on the first hovered info event line
573655 cy . get ( ".mx_GenericEventListSummary_unstyledList .mx_EventTile_info:first-of-type" ) . realHover ( ) ;
574656 cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=true]" ) . click ( { force : false } ) ;
575657
576658 // Make sure "collapse" link button worked
577659 cy . get ( ".mx_GenericEventListSummary_toggle[aria-expanded=false]" ) . should ( "exist" ) ;
660+
661+ // Save snapshot of collapsed generic event list summary on bubble layout
662+ cy . get ( ".mx_MainSplit" ) . percySnapshotElement ( "Collapsed GELS on bubble layout" , { percyCSS } ) ;
578663 } ) ;
579664
580665 it ( "should highlight search result words regardless of formatting" , ( ) => {
0 commit comments