Skip to content

test(loans): behavioral E2E for the discussion #238 loan-form UX - #350

Open
fabiodalez-dev wants to merge 1 commit into
mainfrom
test/discussion-238-loan-form-ux
Open

test(loans): behavioral E2E for the discussion #238 loan-form UX#350
fabiodalez-dev wants to merge 1 commit into
mainfrom
test/discussion-238-loan-form-ux

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

The loan-form UX requested in discussion #238 (comments of 08-04 and 08-11) shipped in v0.7.59 but had only source-invariant test coverage. This adds the missing browser behavioral tests — no application code changes.

Four tests (tests/discussion-238-loan-form-ux.spec.js, 4 passed, deterministic across runs):

  1. "Me" button (#utente_me_btn) fills the logged-in admin as the borrower — asserts #utente_id goes 0 → the admin's real utenti.id (queried from the DB) and the name shows in the visible field.
  2. Form preserved on error — a rejected submit (bad copy code → copy_not_found, DB confirms no loan row) re-renders the form via the loan_form_old session flash; a custom due date is retained, proving it's real retention, not the default re-applied.
  3. Multi-copy quick flow — "Salva e registra un'altra copia" (save_and_new) creates the loan (DB row pinned to the scanned copy), keeps the user + dates, and clears only the copy code for the next scan.
  4. Stale success alert clears on change — after a save-and-new, the "Prestito creato" banner is removed on the first form edit (the actual input/change trigger), including the created=1 URL-flag cleanup.

Self-contained fixtures (two tagged books + copies + a borrower), cleaned in before/afterAll.

The loan-form UX shipped in v0.7.59 (from discussion #238 comments of 08-04 and
08-11) had only source-invariant coverage. Add browser behavioral tests:

- "Me" button (#utente_me_btn) fills the logged-in admin as the borrower —
  DB-verified id.
- A rejected submit re-renders the form with the entered values retained
  (session loan_form_old flash), asserting a custom date survives, not just the
  default.
- "Salva e registra un'altra copia" (save_and_new) creates the loan, keeps the
  user + dates, and clears only the copy code for the next scan.
- The "Prestito creato" success alert is removed on the first form edit (the
  input/change trigger), including the created=1 URL-flag cleanup.

Self-contained fixtures (two tagged books + copies + a borrower), cleaned in
before/afterAll. Green twice, deterministic (4 passed).
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fabiodalez-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2966d6ed-f580-46f7-8afb-819d991724ae

📥 Commits

Reviewing files that changed from the base of the PR and between 057552a and 75fdc3c.

📒 Files selected for processing (1)
  • tests/discussion-238-loan-form-ux.spec.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant