Add support for rendering a custom wrapper around Element (#25537)

Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
This commit is contained in:
maheichyk 2023-08-30 09:52:41 +03:00 committed by GitHub
parent 2ad80c8fcf
commit 3fd6b62254
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 125 additions and 29 deletions

View file

@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { RenderResult, screen, waitFor } from "@testing-library/react";
export function cleanLocalstorage(): void {
window.localStorage.clear();
}
@ -47,3 +49,12 @@ export function deleteIndexedDB(dbName: string): Promise<void> {
throw e;
});
}
// wait for loading page
export async function waitForLoadingSpinner(): Promise<void> {
await screen.findByRole("progressbar");
}
export async function waitForWelcomeComponent(matrixChat?: RenderResult): Promise<void> {
await waitFor(() => matrixChat?.container.querySelector(".mx_Welcome"));
}