Web tests: cover personal payer-transfer invitation submission failures
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- testing
Research direction
Start with web/src/__tests__/PayerTransferJourneys.test.tsx for the existing form fixtures, mocked API, and successful invitation cases; then read web/src/PayerTransferStart.tsx to follow quote and request-key handling. Add component tests using visible controls and deferred beginPayerTransfer promises for temporary failures, retries, and 409 conflicts. Done means the acceptance criteria pass with cd web && npm test -- src/__tests__/PayerTransferJourneys.test.tsx.
Written by the indexing model from the issue text.
Description
The problem
The personal payer-transfer form has two distinct recovery paths when sending an invitation fails:
- A temporary failure retains the reviewed quote and request key for an explicit retry.
- A
409conflict discards that quote and key, requiring the user to review fresh terms.
The journey suite covers successful invitation creation but does not reject beginPayerTransfer to exercise either path. Add component coverage so retrying a request keeps its identity and a conflict cannot reuse outdated terms.
This is a test-coverage task, not a report of a reproduced production defect.
Evidence
Inspected main de5a0e477ff70ff8dcd2493ce2d9dcb4e90fd757:
PersonalTransferStartin PayerTransferStart.tsx:requestQuote()generates the key;createInvitation()retains it after ordinary errors and clears it together with the quote on409.PayerTransferJourneys.test.tsxsupplies the form fixtures and mocked API. Its invitation-creation cases exercise successful responses.
Ran cd web && npm test -- src/__tests__/PayerTransferJourneys.test.tsx: all 19 tests passed on macOS arm64, Node 24.15.0, Vitest 5.0.5 / happy-dom. No live billing requests or native-browser journey were run. Open/closed issues and open PRs were checked for overlap.
Proposed approach
Extend the existing tests for Change who pays (PersonalTransferStart). Drive the organisation/admin selectors, review a quote and submit using the visible controls. Use deferred API promises and compare the arguments of successive beginPayerTransfer calls, without accessing component internals.
Acceptance criteria
- While sending is pending, the send control is disabled and repeated activation does not create a second request.
- Reject the first send with a temporary error. Assert visible error feedback, no success notice, the reviewed quote remains available and the controls recover. No automatic retry occurs.
- Retry explicitly while the quote remains valid. Assert that the retry uses the same quote and request key. Resolve it successfully and verify the error clears and the existing successful-request notice appears.
- In a separate case, reject the send with the API's
server error (409)shape. Assert that the stale quote's send control disappears and the user can request a fresh quote. - After reviewing a different fresh quote and sending again, assert that both the quote and request key differ from the conflicted attempt. Merely requesting that fresh quote must not send an invitation automatically.
- Use synthetic data and controlled promises; restore any spies or clocks. Keep quotes unexpired so these tests isolate request failure from expiry handling.
- Run
cd web && npm test -- src/__tests__/PayerTransferJourneys.test.tsxand record the result in the PR.
Scope
One form's component tests, using the existing mocks. No changes to billing rules or API contracts are required. This is suitable for a first contribution with React Testing Library familiarity.
#647 covers accepting an invitation already in the inbox, #637 covers administrator loading, and #690 covers quote expiry. This task covers sending the initial personal-to-organisation invitation and recovering from its API failure.
Follow CONTRIBUTING.md, including British English and DCO sign-off with git commit -s.
- Dominant language
- Rust
- Stars
- 31
- Forks
- 42
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 142
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsotto/sotto
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
good first issue help wanted test-coverage
Difficulty 2/5 3-5 days Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
software-mansion/pathfinder#3620 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug priority: low
Difficulty 1/5 Under an hour Newbie friendliness 90/100
storytold/wordcraft#6211 · 1 comment ·
Maintainers usually reply within 2 days
-
backlog multiple issues priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
storytold/pdfcraft#6911 · 2 comments ·
Maintainers usually reply within 2 days
-
DGNIMPORT: "The DGN model has nothing that can be imported" when the first element streams are emptyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
HakanSeven12/OpenCADStudio#2820 · 1 comment ·
Maintainers usually reply within 1 day