The screen, within, waitFor, and waitForElementToBeRemoved utilities exported by @testing-library/angular are patched versions of the standard @testing-library/dom utilities.
They are enhanced to automatically trigger Angular's change detection cycle (detectChanges()) before executing queries or callbacks. This ensures that your tests always see the most up-to-date DOM state without requiring manual fixture.detectChanges() calls in most scenarios.
import { render, screen, waitFor } from '@testing-library/angular';
await render(MyComponent);
// waitFor automatically triggers change detection
await waitFor(() => {
expect(screen.getByText('Loaded')).toBeInTheDocument();
});