* 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)
| 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. |
no test coverage detected
searching dependent graphs…