The small adventure
When an administrator welcomes a new Formulus user, Synkronus Portal can create
a strong handoff password. The generator intentionally avoids look-alike
characters and guarantees several character classes, but it currently has no
focused automated tests.
This is a friendly first mission: learn one Portal utility, add the missing test
plumbing, and make an important onboarding path less mysterious.
Where to start
synkronus-portal/src/utils/password.ts
synkronus-portal/package.json
synkronus-portal/AGENTS.md
What to change
- Add the smallest test setup that fits the existing Vite + TypeScript project
(Vitest is the natural choice unless the project has changed by the time this
issue is picked up).
- Add focused tests for
generateStrongPassword covering:
- default length;
- the minimum length when a smaller value is requested;
- a requested length above the minimum;
- at least one uppercase letter, lowercase letter, digit, and symbol;
- exclusion of the documented ambiguous characters
0, O, 1, l, and
I.
- Keep tests deterministic by stubbing
crypto.getRandomValues; do not weaken
or replace the production randomness.
- Add a package script for running the tests.
Guardrails
- Do not test that two random calls happen to return different passwords; that
makes a flaky test, not a stronger one.
- Do not mock
generateStrongPassword itself.
- Keep the scope on this utility and its test setup. A wider Portal test-suite
migration is a separate project.
Done when
Verify it
From synkronus-portal/:
pnpm run lint
pnpm run format:check
pnpm test
pnpm run build
What you will meet along the way
Portal is an ordinary client of Synkronus's public API, not a secret admin
backdoor. This utility sits in the flow where an administrator creates a user
who will later collect and synchronize data with Formulus.
AI tools are welcome, not required
AI can help draft the Vitest configuration or enumerate edge cases. Please read
the generator first, choose assertions that test its public contract, and be
ready to explain why your randomness stub is deterministic. A generated pile of
tests is less useful than five tests you understand.
The small adventure
When an administrator welcomes a new Formulus user, Synkronus Portal can create
a strong handoff password. The generator intentionally avoids look-alike
characters and guarantees several character classes, but it currently has no
focused automated tests.
This is a friendly first mission: learn one Portal utility, add the missing test
plumbing, and make an important onboarding path less mysterious.
Where to start
synkronus-portal/src/utils/password.tssynkronus-portal/package.jsonsynkronus-portal/AGENTS.mdWhat to change
(Vitest is the natural choice unless the project has changed by the time this
issue is picked up).
generateStrongPasswordcovering:0,O,1,l, andI.crypto.getRandomValues; do not weakenor replace the production randomness.
Guardrails
makes a flaky test, not a stronger one.
generateStrongPassworditself.migration is a separate project.
Done when
generateStrongPasswordhas deterministic tests for the behavior above.pnpmtest command inpackage.json.uncovers a genuine bug, in which case describe it in the pull request.
Verify it
From
synkronus-portal/:pnpm run lint pnpm run format:check pnpm test pnpm run buildWhat you will meet along the way
Portal is an ordinary client of Synkronus's public API, not a secret admin
backdoor. This utility sits in the flow where an administrator creates a user
who will later collect and synchronize data with Formulus.
AI tools are welcome, not required
AI can help draft the Vitest configuration or enumerate edge cases. Please read
the generator first, choose assertions that test its public contract, and be
ready to explain why your randomness stub is deterministic. A generated pile of
tests is less useful than five tests you understand.