@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
88*/
99
1010import type { Locator , Page } from "@playwright/test" ;
11- import { test , expect } from "../../element-web-test" ;
11+ import { test , expect , type ExtendedToMatchScreenshotOptions } from "../../element-web-test" ;
1212import { SettingLevel } from "../../../src/settings/SettingLevel" ;
1313import { Layout } from "../../../src/settings/enums/Layout" ;
1414import { type ElementAppPage } from "../../pages/ElementAppPage" ;
@@ -94,7 +94,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
9494 // Assert that rendering of the player settled and the play button is visible before taking a snapshot
9595 await checkPlayerVisibility ( ircTile ) ;
9696
97- const screenshotOptions = {
97+ const screenshotOptions : ExtendedToMatchScreenshotOptions = {
9898 css : `
9999 /* The timestamp is of inconsistent width depending on the time the test runs at */
100100 .mx_MessageTimestamp {
@@ -120,7 +120,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
120120 } ;
121121
122122 // Take a snapshot of mx_EventTile_last on IRC layout
123- screenshotOptions . clip = await page . locator ( ".mx_EventTile_last" ) . boundingBox ( ) ;
123+ screenshotOptions . clip = ( await page . locator ( ".mx_EventTile_last" ) . boundingBox ( ) ) ?? undefined ;
124124 await scrollToBottomOfTimeline ( page ) ;
125125 await expect ( page ) . toMatchScreenshot ( `${ detail . replaceAll ( " " , "-" ) } -irc-layout.png` , screenshotOptions ) ;
126126
@@ -129,7 +129,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
129129 const groupTile = page . locator ( ".mx_EventTile_last[data-layout='group']" ) ;
130130 await groupTile . locator ( ".mx_MessageTimestamp" ) . click ( ) ;
131131 await checkPlayerVisibility ( groupTile ) ;
132- screenshotOptions . clip = await page . locator ( ".mx_EventTile_last" ) . boundingBox ( ) ;
132+ screenshotOptions . clip = ( await page . locator ( ".mx_EventTile_last" ) . boundingBox ( ) ) ?? undefined ;
133133 await scrollToBottomOfTimeline ( page ) ;
134134 await expect ( page ) . toMatchScreenshot ( `${ detail . replaceAll ( " " , "-" ) } -group-layout.png` , screenshotOptions ) ;
135135
@@ -138,7 +138,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
138138 const bubbleTile = page . locator ( ".mx_EventTile_last[data-layout='bubble']" ) ;
139139 await bubbleTile . locator ( ".mx_MessageTimestamp" ) . click ( ) ;
140140 await checkPlayerVisibility ( bubbleTile ) ;
141- screenshotOptions . clip = await page . locator ( ".mx_EventTile_last" ) . boundingBox ( ) ;
141+ screenshotOptions . clip = ( await page . locator ( ".mx_EventTile_last" ) . boundingBox ( ) ) ?? undefined ;
142142 await scrollToBottomOfTimeline ( page ) ;
143143 await expect ( page ) . toMatchScreenshot ( `${ detail . replaceAll ( " " , "-" ) } -bubble-layout.png` , screenshotOptions ) ;
144144 } ;
0 commit comments