Skip to content

Conversation

@karancs06
Copy link
Contributor

No description provided.

…entAddButton

- Add microtask wait for Preact component rendering in variant icon test
- Add microtask wait for button generation loops (5 buttons) to complete
- Fixes 2 remaining timeout failures

All tests now passing locally with optimized performance
- Added mock for getFieldVariantStatus() with correct BASE_VARIANT_STATUS structure
- Added mock for FIELD_LOCATION_DATA postMessage event to prevent hanging
- Fixed visualBuilderPostMessage.send() mock to handle all event types properly
- Reverted test timeout back to 30s (root cause was missing mocks, not timeout)
- Tests that were timing out at 30s+ now complete in 5-20s each
- All 813 tests passing locally in ~94 seconds
…eep() calls

- Removed 7 artificial delays (sleep(0) and setTimeout(0))
- Buttons are appended synchronously to DOM, no need to wait
- Test duration: 44s → 9s locally (80% improvement)
- Expected CI improvement: ~7 minutes saved (based on 13x slowdown factor)

Changes:
- Replaced 'await sleep(0)' with direct synchronous DOM queries
- Replaced 'await new Promise(resolve => setTimeout(resolve, 0))' with synchronous queries
- Added clarifying comments that buttons are appended synchronously

All 20 tests still pass. Optimization is safe and maintains test integrity.
@karancs06 karancs06 requested a review from a team as a code owner December 4, 2025 07:13
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 71.38% 7829 / 10967
🔵 Statements 71.38% 7829 / 10967
🔵 Functions 74.82% 312 / 417
🔵 Branches 85.09% 1153 / 1355
File CoverageNo changed files found.
Generated in workflow #696 for commit 92ed05a by the Vitest Coverage Report Action

Copy link
Contributor

@hiteshshetty-dev hiteshshetty-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@karancs06 karancs06 merged commit 0716ad8 into stage_v4 Dec 4, 2025
10 checks passed
@karancs06 karancs06 deleted the vitest-3-stage branch December 4, 2025 11:53
@hiteshshetty-dev hiteshshetty-dev mentioned this pull request Dec 5, 2025
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.

3 participants