Repository navigation
test(mail): cover how a request picks the email account (#219) - #244
Merged
juancguerrerodev merged 3 commits intoDec 6, 2026
Merged
juancguerrerodev merged 3 commits into
juancguerrerodev merged 3 commits into
Conversation
10 of 16 tasks
Contributor
|
Ready to merge once the pull request template is filled in, including the "I read and ran everything" box (details on #234). 🦀 |
juancguerrerodev
force-pushed
the
test/mail-accounts-219
branch
from
December 6, 2026 07:57
88a75b1 to
1d16fe2
Compare
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.
Closes #219
When someone has more than one email account, Hermit picks the one they meant with
resolveAccounts()inpackages/mail/src/accounts.ts(US-MAIL-08): by address, then by label, then by provider, then by part of an addressor label. Neither it nor
accountName()had a test that called it directly.What this PR does
packages/mail/test/accounts.test.ts(Vitest, like the other files inpackages/mail/test), importing from../src/accounts.ts. Tests only:accounts.tsis unchanged, and themodelTextwording is not changed, only whatit contains is checked.
Tests
accountName: an account with a label readsaddress (label); one without reads just the address.resolveAccountswith no accounts givesok: false.undefined,"", or a value that is not a string) it gives every account, inorder.
MAIL_SERVICE_NAMES.ok: false, and its text names the connected accounts and cuts what was wanted to 100 characters.MemoryMailAccountStore:savereplaces by id,getandlistreturn copies, anddeletereports whether itremoved anything.
How to check
Keep in mind
example.comaddresses only.Pull request template
What and why
Closes #219.
Adds direct tests for how a mail request picks its account.
Vision fit
Principle 3, the model proposes, code decides: account picking is code's tiered matching over the user's words, now pinned by tests.
Non-negotiables
Checklist
acceptedproposal.pnpm check:privacy,pnpm typecheck,pnpm lint,pnpm testandnode scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Gate note: privacy and guard pass on this checkout today; the rest was run per package as listed under AI agents, not as one root gate on this Windows machine, where unrelated pre-existing failures appear in the site badges, the devices table and mobile source scans.packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes.Model path
packages/model,agent,skillsoreval, the prompt, the router, tool descriptions, normalizers, examples or the model file.Screenshots
New dependencies and network calls
None. No new dependency and no new network call.
AI agents
What was run: pnpm --filter @hermit/mail exec vitest run test/accounts.test.ts (10/10); full @hermit/mail test at the time; typecheck; eslint.