(
+
+ Failed: {error.message}
+
+
+ )}
+ >
+
+
+ );
+
+ expect(screen.getByText('Failed: Flaky failure')).toBeTruthy();
+
+ shouldThrow.current = false;
+ await userEvent.click(screen.getByRole('button', { name: 'Retry now' }));
+
+ expect(screen.getByText('Recovered content')).toBeTruthy();
+ });
+ });
+
+ describe('onError', () => {
+ test('should be called once with the error and component stack', () => {
+ const onError = vi.fn();
+
+ render(
+