Repository navigation
test: fix two flaky tests (contact sheet teardown, domain-auth org lookup) - #243
Merged
Merged
Conversation
…act sheet test The sheet's FocusScope dispatches a CustomEvent from a setTimeout(0) on unmount. When the last test's cleanup ran just before vitest tore down jsdom, the timer fired against Node's CustomEvent and test-web failed with an unhandled error even though every test passed. Mirror the afterEach already used in contacts-table-analytics.test.tsx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GxJAQNczULQx7FgrxWxAyE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
The isolation test writes an orgB row with the same awsAccountId and recordName as orgA's. rowFor filtered by account and record name only and took the first row, so test-db failed whenever Postgres returned orgB's row first. Scope rowFor (and the MAIL FROM query) to orgA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GxJAQNczULQx7FgrxWxAyE
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two flaky tests, both test-only fixes.
1.
test-web:contact-details-sheet.test.tsxunhandled error. It failed #242 andagent-tier3with every test passing:Radix FocusScope dispatches its unmount event from a
setTimeout(0). If the last test's cleanup runs right before vitest tears down jsdom, that timer fires against Node'sCustomEvent. This applies theafterEachthatcontacts-table-analytics.test.tsxalready uses:2.
test-db:repository-domain-auth-db.test.ts› "neither reads nor updates another org's rows". The test writes an orgB row with the sameawsAccountIdandrecordNameas orgA's.rowFordidn't filter by org and took[row], so it compared orgA's "before" against whichever row Postgres returned first. The repository was correct: orgB got its own row.rowFor(name) where + organizationId = orgA awsAccountId = acctA recordName = nameThis still catches a real leak: if
recordDomainAuthCheckupdated orgA's row from orgB, the scopedafterwould differ frombefore.Evidence
3846 passed,Errors 1 error, exit 1. The same error also appears in run 41219334790.Received … "organizationId": "repo-dac-org-b-…"atrepository-domain-auth-db.test.ts:207.contact-details-sheet.test.tsx: 19 passed.repository-domain-auth-db.test.ts: 8 passed.Merge Danger
Door: two-way
Blast Radius: none (two test files)
🤖 Generated with Claude Code
https://claude.ai/code/session_01GxJAQNczULQx7FgrxWxAyE