@@ -20,7 +20,6 @@ import { MessageEvent } from "matrix-events-sdk";
2020
2121import type { ISendEventResponse } from "matrix-js-sdk/src/@types/requests" ;
2222import type { EventType } from "matrix-js-sdk/src/@types/event" ;
23- import type { MatrixClient } from "matrix-js-sdk/src/client" ;
2423import { SynapseInstance } from "../../plugins/synapsedocker" ;
2524import { SettingLevel } from "../../../src/settings/SettingLevel" ;
2625import { Layout } from "../../../src/settings/enums/Layout" ;
@@ -46,10 +45,14 @@ const expectDisplayName = (e: JQuery<HTMLElement>, displayName: string): void =>
4645} ;
4746
4847const expectAvatar = ( e : JQuery < HTMLElement > , avatarUrl : string ) : void => {
49- cy . getClient ( ) . then ( ( cli : MatrixClient ) => {
48+ cy . all ( [
49+ cy . window ( { log : false } ) ,
50+ cy . getClient ( ) ,
51+ ] ) . then ( ( [ win , cli ] ) => {
52+ const size = AVATAR_SIZE * win . devicePixelRatio ;
5053 expect ( e . find ( ".mx_BaseAvatar_image" ) . attr ( "src" ) ) . to . equal (
5154 // eslint-disable-next-line no-restricted-properties
52- cli . mxcUrlToHttp ( avatarUrl , AVATAR_SIZE , AVATAR_SIZE , AVATAR_RESIZE_METHOD ) ,
55+ cli . mxcUrlToHttp ( avatarUrl , size , size , AVATAR_RESIZE_METHOD ) ,
5356 ) ;
5457 } ) ;
5558} ;
@@ -75,15 +78,17 @@ describe("Timeline", () => {
7578 cy . startSynapse ( "default" ) . then ( data => {
7679 synapse = data ;
7780 cy . initTestUser ( synapse , OLD_NAME ) . then ( ( ) =>
78- cy . window ( { log : false } ) . then ( ( ) => {
79- cy . createRoom ( { name : ROOM_NAME } ) . then ( _room1Id => {
80- roomId = _room1Id ;
81- } ) ;
81+ cy . createRoom ( { name : ROOM_NAME } ) . then ( _room1Id => {
82+ roomId = _room1Id ;
8283 } ) ,
8384 ) ;
8485 } ) ;
8586 } ) ;
8687
88+ afterEach ( ( ) => {
89+ cy . stopSynapse ( synapse ) ;
90+ } ) ;
91+
8792 describe ( "useOnlyCurrentProfiles" , ( ) => {
8893 beforeEach ( ( ) => {
8994 cy . uploadContent ( OLD_AVATAR ) . then ( ( url ) => {
@@ -95,10 +100,6 @@ describe("Timeline", () => {
95100 } ) ;
96101 } ) ;
97102
98- afterEach ( ( ) => {
99- cy . stopSynapse ( synapse ) ;
100- } ) ;
101-
102103 it ( "should show historical profiles if disabled" , ( ) => {
103104 cy . setSettingValue ( "useOnlyCurrentProfiles" , null , SettingLevel . ACCOUNT , false ) ;
104105 sendEvent ( roomId ) ;
@@ -146,11 +147,16 @@ describe("Timeline", () => {
146147 } ) ;
147148
148149 describe ( "message displaying" , ( ) => {
150+ beforeEach ( ( ) => {
151+ cy . injectAxe ( ) ;
152+ } ) ;
153+
149154 it ( "should create and configure a room on IRC layout" , ( ) => {
150155 cy . visit ( "/#/room/" + roomId ) ;
151156 cy . setSettingValue ( "layout" , null , SettingLevel . DEVICE , Layout . IRC ) ;
152157 cy . contains ( ".mx_RoomView_body .mx_GenericEventListSummary[data-layout=irc] " +
153158 ".mx_GenericEventListSummary_summary" , "created and configured the room." ) ;
159+ cy . get ( ".mx_Spinner" ) . should ( "not.exist" ) ;
154160 cy . percySnapshot ( "Configured room on IRC layout" ) ;
155161 } ) ;
156162
@@ -174,10 +180,12 @@ describe("Timeline", () => {
174180 . should ( 'have.css' , "margin-inline-start" , "104px" )
175181 . should ( 'have.css' , "inset-inline-start" , "0px" ) ;
176182
183+ cy . get ( ".mx_Spinner" ) . should ( "not.exist" ) ;
177184 // Exclude timestamp from snapshot
178185 const percyCSS = ".mx_RoomView_body .mx_EventTile_info .mx_MessageTimestamp "
179186 + "{ visibility: hidden !important; }" ;
180187 cy . percySnapshot ( "Event line with inline start margin on IRC layout" , { percyCSS } ) ;
188+ cy . checkA11y ( ) ;
181189 } ) ;
182190
183191 it ( "should set inline start padding to a hidden event line" , ( ) => {
0 commit comments