Repository navigation
web: add unit tests for the date and label formatters - #70
Open
nahuel007ng wants to merge 1 commit into
Open
nahuel007ng wants to merge 1 commit into
nahuel007ng wants to merge 1 commit into
Conversation
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.
What
Closes #64
Adds
apps/web/src/lib/fmt.test.tswith 24 tests forapps/web/src/lib/fmt.ts, which had no tests.fmt.tsitself is unchanged.initials: two names, one name, three names (first and last), blank input.visibleTags: dropsext:tags and keeps the rest.daysUntilanddueLabel: today, tomorrow, yesterday, 2 to 6 days out, a later date this year, and a date in another year.snoozePreset:tomorrowandweekfrom a mid-week day and from a Monday (lands on the next Monday at 9:00).snoozeUntilLabel: lowercases today and tomorrow mid-sentence, and leaves "Fri" and "12 Mar" alone.Dates use the local
new Date(y, m, d, h)constructor with fake timers, so the tests do not depend on the time zone. They pass withTZset to UTC, America/Buenos_Aires, Pacific/Kiritimati (UTC+14) and Pacific/Pago_Pago (UTC-11).Gates run locally with Node 22 and pnpm 11.12.0:
pnpm typecheckpasses,pnpm -r testpasses (web 131, core 415, api 476, importer 63), andpnpm --filter @flow/web buildsucceeds.Checklist
pnpm typecheckandpnpm -r testpass locallywrangler.jsonc) are included — onlywrangler.example.jsoncplaceholders@flow/sharedschemas, DO storage shape, MCP tools) are called out belowContract changes
None