adevinta / spark

✨ Simple, Modular & Accessible UI Components for your React Applications
https://sparkui.vercel.app
MIT License
73 stars 21 forks source link

refactor: split tests into multiple steps #2330

Closed acd02 closed 3 months ago

acd02 commented 3 months ago

Description, Motivation and Context

https://x.com/housecor/status/1816867564796117228

Types of changes

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.47%. Comparing base (b1a8d54) to head (6742358). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2330 +/- ## ======================================= Coverage 96.47% 96.47% ======================================= Files 493 493 Lines 4141 4141 Branches 1305 1305 ======================================= Hits 3995 3995 Misses 144 144 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Powerplex commented 3 months ago

I am confused (even after reading the tweet) about why it improves performance, as you were already using page.goto() only once per test.

How does test.step improves things ? Reading the doc I think it only improves readability by splitting long tests into smaller tests. Am I right that our tests were already performant because page was already loaded only once ?

acd02 commented 3 months ago

Yes, in our case, it won't improve performance, it's just a way of better organizing our tests by splitting them into multiple steps 👍