Review main Merged

85521[TASK] Use mock timers in notification test

Andreas Kienast CR +2 V +2 Easy +22 −9 updated 08/06/24, 12:09

Commit message

The previous implementation of notification tests relied on real browser
timeouts, artifically slowing down their execution (roughly 11 seconds).

Sinon (the stub library we use) provides API to mock several timing
functions (e.g. `setTimeout()`) which can be incorporated for most
cases.

There's one caveat tho: notifications are visually hidden with an
animation that executes for 400 ms and get removed from DOM after that.
Sinon cannot mock timings for CSS-driven animations. To workaround this,
a new event is introduced that is usually triggered after animation has
ended.

This reduces the runtime of the affected test from ~11 seconds to ~1.2
seconds.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Christian Kuhn +1
    • Benni Mack +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Christian Kuhn +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 68

  1. Andreas Kienast uploaded patch set 1 08/06/24, 10:49

  2. Andreas Kienast uploaded patch set 2 08/06/24, 10:50

  3. core-ci voted on patch set 1 V -1 08/06/24, 10:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62897

  4. core-ci voted on patch set 2 V +1 08/06/24, 10:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62898

  5. Christian Kuhn voted on patch set 2 CR +1 V +1 08/06/24, 11:00

  6. Benni Mack voted on patch set 2 CR +1 V +1 08/06/24, 11:45

  7. Andreas Kienast voted on patch set 2 CR +2 V +2 08/06/24, 11:49

  8. Andreas Kienast merged patch set 3 08/06/24, 12:09