Skip to content

Add unit tests for WidgetBlocks.js and improve test coverage (#4914)#5549

Open
severe77 wants to merge 2 commits intosugarlabs:masterfrom
severe77:widgetblocks-tests-clean
Open

Add unit tests for WidgetBlocks.js and improve test coverage (#4914)#5549
severe77 wants to merge 2 commits intosugarlabs:masterfrom
severe77:widgetblocks-tests-clean

Conversation

@severe77
Copy link
Contributor

@severe77 severe77 commented Feb 5, 2026

This pull request adds unit tests for WidgetBlocks.js.


What’s included

  • Tests to verify widget blocks are registered correctly
  • Coverage for core widget setup logic (e.g. Tempo, Sampler, Status, etc.)
  • Ensures setupWidgetBlocks runs without errors in a test environment

Purpose

WidgetBlocks.js previously lacked direct unit test coverage.
These tests help validate block registration behavior and reduce the risk of regressions.


Testing

  • Tests added using the existing Jest setup
  • All tests pass locally

Attached test coverage screenshot

The screenshot below shows the updated Jest test coverage
Screenshot 2026-02-05 165513

Notes

  • No production logic was changed
  • Follows existing test patterns used in other block test files
  • Improves test coverage and overall reliability

Fixes #4914

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

✅ All Jest tests passed! This PR is ready to merge.

@7se7en72025
Copy link
Contributor

Great work on expanding the test coverage! 🚀 @severe77

I noticed the ESLint check failed due to some formatting inconsistencies in js/blocks/WidgetBlocks.js. You should be able to fix this automatically by running:

npx prettier --write js/blocks/WidgetBlocks.js

Once you push that change, the build should pass.

Cheers to opensource !!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

✅ All Jest tests passed! This PR is ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for WidgetBlocks.js

2 participants