8000 feat(client): handle css transitions in lessons by ojeytonwilliams · Pull Request #64712 · freeCodeCamp/freeCodeCamp · GitHub 8000
[go: up one dir, main page]

Skip to content

Conversation

@ojeytonwilliams
Copy link
Contributor
@ojeytonwilliams ojeytonwilliams commented Dec 17, 2025
  • chore: release v7.2.0
  • feat: let challenges opt into allowing animation
  • fix(curriculum): handle transitions in lab-feature-selection

Checklist:

This needs the latest curriculum helpers, but that PR can go in independently.

Closes #63678
Closes #64190, though @majestic-owl448 I've simplified the test to only check a single checkbox. If you'd rather keep testing them all, please modify this PR as you like.

@ojeytonwilliams ojeytonwilliams requested review from a team as code owners December 17, 2025 15:51
@github-actions github-actions bot added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. labels Dec 17, 2025
@majestic-owl448
Copy link
Contributor
majestic-owl448 commented Dec 17, 2025

I am fine with having a single checkbox being tested in this way, I am not sure we would want to increase the time of the test too much using retryingTest multiple times (It's one of the reasons my attempt was with the fake timers)

the other reason for trying with the fake timers was because if the checkbox is checked to start, which could maybe happen if one of the checkboxes is checked by default, from checked to unchecked would also take the time of transition and this would get the wrong color:

checkbox.checked = false;
const uncheckedBG = window.getComputedStyle(checkbox).backgroundColor;

@ojeytonwilliams
Copy link
Contributor Author

Unfortunately, and I keep forgetting this, but fake timers can't help us here. They don't modify how css transitions behave, so we do have to wait. What we can do is check for any change in the tested property. It should start changing almost immediately. That's already the case for these test and they are pretty fast.

checked to unchecked would also take the time of transition and this would get the wrong color

Yes, that's still an issue. I didn't want to complicate things too much in this PR, but, now that transitions are happening, you can design more elaborate tests if need be.

@majestic-owl448
Copy link
Contributor

I would say, the lab can go like this, and now that the testing works, we can iterate later, and for this PR focus on reviewing everything else

@majestic-owl448 majestic-owl448 added the MERGE CONFLICT! To be applied to PR's that have a merge conflict and need updating label Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MERGE CONFLICT! To be applied to PR's that have a merge conflict and need updating platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transition property not compatible with tests

2 participants

0