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 07:52:41 +01:00
committed by GitHub
co-authored by Mikhail Aheichyk
parent 2ad80c8fcf
commit 3fd6b62254
6 changed files with 125 additions and 29 deletions
+11
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"));
}