MCPcopy Index your code
hub / github.com/angular/components / assertNextButtonScrolling

Function assertNextButtonScrolling

src/material/tabs/tab-header.spec.ts:500–528  ·  view source on GitHub ↗

* Asserts that auto scrolling using the next button works. * @param startEventName Name of the event that is supposed to start the scrolling. * @param endEventName Name of the event that is supposed to end the scrolling.

(startEventName: string, endEventName: string)

Source from the content-addressed store, hash-verified

498 * @param endEventName Name of the event that is supposed to end the scrolling.
499 */
500 async function assertNextButtonScrolling(startEventName: string, endEventName: string) {
501 expect(header.scrollDistance).withContext('Expected to start off not scrolled.').toBe(0);
502
503 dispatchFakeEvent(nextButton, startEventName);
504 fixture.detectChanges();
505 await wait(300);
506
507 expect(header.scrollDistance)
508 .withContext('Expected not to scroll after short amount of time.')
509 .toBe(0);
510
511 await wait(600);
512
513 expect(header.scrollDistance)
514 .withContext('Expected to scroll after some time.')
515 .toBeGreaterThan(0);
516
517 let previousDistance = header.scrollDistance;
518
519 // Wait for interval (100ms)
520 await wait(200);
521
522 expect(header.scrollDistance)
523 .withContext('Expected to scroll again after some more time.')
524 .toBeGreaterThan(previousDistance);
525
526 dispatchFakeEvent(nextButton, endEventName);
527 await wait(100);
528 }
529
530 /**
531 * Asserts that auto scrolling using the previous button works.

Callers 1

tab-header.spec.tsFile · 0.85

Calls 2

dispatchFakeEventFunction · 0.85
waitFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…