frontend-test-utils: switch createExtensionTester render to be sync

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: Philipp Hugenroth <philipph@spotify.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-11-15 13:43:33 +01:00
parent 3f0f3bbf10
commit 326a9e40e1
5 changed files with 10 additions and 14 deletions
@@ -54,9 +54,7 @@ describe('ExtensionBoundary', () => {
const TextComponent = () => {
return <p>{text}</p>;
};
await createExtensionTester(
wrapInBoundaryExtension(<TextComponent />),
).render();
createExtensionTester(wrapInBoundaryExtension(<TextComponent />)).render();
await waitFor(() => expect(screen.getByText(text)).toBeInTheDocument());
});
@@ -65,9 +63,7 @@ describe('ExtensionBoundary', () => {
const ErrorComponent = () => {
throw new Error(error);
};
await createExtensionTester(
wrapInBoundaryExtension(<ErrorComponent />),
).render();
createExtensionTester(wrapInBoundaryExtension(<ErrorComponent />)).render();
await waitFor(() => expect(screen.getByText(error)).toBeInTheDocument());
});
@@ -84,7 +80,7 @@ describe('ExtensionBoundary', () => {
return null;
};
await createExtensionTester(
createExtensionTester(
wrapInBoundaryExtension(
<TestApiProvider apis={[[analyticsApiRef, analyticsApiMock]]}>
<AnalyticsComponent />