app-next: fix app test

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-08 16:40:28 +02:00
parent c55a1a4a93
commit cd2eed66d7
+7 -3
View File
@@ -14,9 +14,13 @@
* limitations under the License.
*/
import React from 'react';
import { renderWithEffects } from '@backstage/test-utils';
jest.mock('@backstage/plugin-graphiql', () => ({
...jest.requireActual('@backstage/plugin-graphiql'),
GraphiQLIcon: () => null,
}));
describe('App', () => {
it('should render', async () => {
process.env = {
@@ -41,8 +45,8 @@ describe('App', () => {
] as any,
};
const { default: App } = await import('./App');
const rendered = await renderWithEffects(<App />);
const { default: app } = await import('./App');
const rendered = await renderWithEffects(app);
expect(rendered.baseElement).toBeInTheDocument();
});
});