Skip to content

Commit 6af473a

Browse files
fix: prevent makeBodyVisible timeout from running after test teardown (calcom#22972)
* fix: prevent makeBodyVisible timeout from running after test teardown - Add timeout tracking to makeBodyVisible function to enable cleanup - Add vi.clearAllTimers() to test teardown to clear recursive timeouts - Prevents 'ReferenceError: document is not defined' in CI tests Fixes intermittent test failures where makeBodyVisible recursive timeout continues running after test environment is torn down. Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * simplify: use only vi.clearAllTimers() to fix timeout issue Based on code review feedback, test if vi.clearAllTimers() alone is sufficient without modifying makeBodyVisible function. - Reverted makeBodyVisible function changes - Kept only vi.clearAllTimers() in test teardown - Verified with multiple test runs and type checking Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent bf8f966 commit 6af473a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/embeds/embed-core/src/__tests__/embed-iframe.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ afterEach(() => {
1111
vi.clearAllMocks();
1212
vi.resetModules();
1313
vi.useRealTimers();
14+
vi.clearAllTimers();
1415
});
1516

1617
describe("embedStore.router.ensureQueryParamsInUrl", async () => {

0 commit comments

Comments
 (0)