Overview
…
Then I remembered something @jessebaker said on Slack: maybe it's a dev vs. production build issue. That's it! 💫I was able to confirm that testing the app after
npm run build(and reverting my fix) doesn't present the issue! This is because there are no subsequent re-renders occurring for theInputBehaviorscomponent in the production build. They happen in development mode thanks to our use of<StrictMode>, which helps us catch bugs by double rendering in development. That's exactly what happened here. The fix is still valid and necessary.…
AFAICT we could've caught this automatically.
Proposed resolution
Add new cypress E2E debug CI job that's identical to the cypress E2E job, with two exceptions:
- it uses the debug build (
npm run drupaldev, notnpm run build) - it does not run always, only when the UI is changed (and of course for the
0.xbranch + manually)
User interface changes
None.
Issue fork experience_builder-3494513
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
wim leersComment #5
wim leers… oops,
npm run drupaldevis long-running 😅I'll let @balintbrews adjust that! 🤓
Comment #6
balintbrewsI think our end-to-end test coverage should be focused on the end user's experience. React's
<StrictMode>is wonderful for development, and you're right that if it makes our app behave differently, that's most likely a bug. The kind of problems<StrictMode>potentially surfaces during development, we should fix and verify at the unit testing layer using Vitest, which we recently introduced in #3516390: Compile Tailwind CSS globally for code components.