mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(platform-server): clean up viewport hydration observer
Trigger routed viewport hydration so its cached observer is removed before later randomized specs run.
(cherry picked from commit 870a525bd3)
This commit is contained in:
@@ -1376,6 +1376,12 @@ describe('platform-server partial hydration integration', () => {
|
||||
|
||||
expect(activeObservers.length).toBe(1);
|
||||
expect(activeObservers[0].options).toEqual({rootMargin: '123px', threshold: 0.5});
|
||||
|
||||
const article = doc.getElementsByTagName('article')[0];
|
||||
MockIntersectionObserver.invokeCallbacksForElement(article, true);
|
||||
await appRef.whenStable();
|
||||
|
||||
expect(activeObservers[0].observedElements.size).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user