Fix TechDocs test

Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
Philipp Hugenroth
2023-05-03 14:49:48 +02:00
parent 9b714a9bfd
commit 103cd94ef1
3 changed files with 5 additions and 5 deletions
@@ -21,7 +21,7 @@ import React, { ReactElement } from 'react';
import { screen } from 'testing-library__dom';
import { renderToStaticMarkup } from 'react-dom/server';
import { Route } from 'react-router-dom';
import { act, render } from '@testing-library/react';
import { act, render, waitFor } from '@testing-library/react';
import { wrapInTestApp, TestApiProvider } from '@backstage/test-utils';
import { FlatRoutes } from '@backstage/core-app-api';
@@ -278,7 +278,9 @@ export class TechDocsAddonTester {
render(this.build());
});
const shadowHost = screen.getByTestId('techdocs-native-shadowroot');
await waitFor(() => screen.getByText('Documentation'));
const shadowHost = await screen.findByTestId('techdocs-native-shadowroot');
return {
...screen,