Bug 1853765 - Use BrowserTestUtils.is_visible instead of workaround in browser_file_migration.js. r=kpatenio

Differential Revision: https://phabricator.services.mozilla.com/D188517
This commit is contained in:
Mike Conley
2023-09-19 20:42:16 +00:00
parent 4dc0cf2fc6
commit a6165845b4

View File

@@ -291,14 +291,8 @@ add_task(async function test_file_migration_error() {
);
let errorMessageContainer = shadow.querySelector(".file-import-error");
// Using BrowserTestUtils.is_visible to check for the visibility of the
// message seems to throw as it works its way up the ancestry and hits
// the shadowRoot. We'll work around this by making sure that the
// boundingClientRect has a width and height.
let errorRect = errorMessageContainer.getBoundingClientRect();
Assert.ok(
errorRect.width && errorRect.height,
BrowserTestUtils.is_visible(errorMessageContainer),
"Should be showing the error message container"
);