Chore: Log error from App loading in console and faro (#79977)

* Chore: Log error from App loading in console and faro

* Add error spy for console
This commit is contained in:
Esteban Beltran
2024-01-03 15:51:31 +01:00
committed by GitHub
parent c219a19f97
commit 5c67c4b082
2 changed files with 9 additions and 2 deletions

View File

@ -103,9 +103,12 @@ describe('AppRootPage', () => {
});
it("should show a not found page if the plugin settings can't load", async () => {
jest.spyOn(console, 'error').mockImplementation();
getPluginSettingsMock.mockRejectedValue(new Error('Unknown Plugin'));
// Renders once for the first time
await renderUnderRouter();
await act(async () => {
await renderUnderRouter();
});
expect(await screen.findByText('App not found')).toBeVisible();
});