Aman-Mittal opened a new pull request, #681:
URL: https://github.com/apache/fineract-backoffice-ui/pull/681
## What and why
The e2e half of #669, which landed without it — #669 merged at its second
commit while this spec was still being written, so the fix is on `main` with
unit coverage but no browser coverage.
Adds `e2e/collection-sheet.spec.ts` to the `backend` project. It drives the
screen against a live Fineract and asserts the three things #669 repaired:
- the staff select is **disabled** until an office is chosen, because
Fineract scopes staff by office and refuses one from elsewhere;
- choosing an office issues `GET /staff?officeId=N` and fills the select;
- the chosen officer **reaches the request body** — the defect that mattered
most, because it was invisible from the UI: the dropdown populated, an officer
could be picked, the form submitted, and a result came back.
```ts
expect(await isIonSelectDisabled(page, 'Staff')).toBe(true);
await selectOption(page, 'Office', 'Head Office');
await staffLoaded;
expect(await isIonSelectDisabled(page, 'Staff')).toBe(false);
await selectOption(page, 'Staff', staff.staffName);
const body = (await generated).postDataJSON() as Record<string, unknown>;
expect(body).toMatchObject({ officeId: 1, staffId: staff.staffId });
```
`isIonSelectDisabled()` reads the host property rather than an attribute,
because the disabled state lives in shadow DOM. `selectOption()` is the
existing helper — these selects are `interface="popover"`, which commits on
click and has no OK button, so a hand-rolled interaction waits for a button
that never appears.
## Verification
```
playwright --project=backend collection-sheet 2 passed (53.8s)
npm run typecheck:e2e clean
prettier --check clean
```
Re-run on current `main` rather than on the branch it was written against,
since the fix it covers is already merged.
Previously mutation-tested on #669: dropping `staffId` from `buildBody()`
fails on exactly the missing field —
```
expect(received).toMatchObject(expected)
Object {
"officeId": 1,
- "staffId": 15,
}
```
## Note
This adds `collection-sheet.spec.ts` to `BACKEND_SPECS`. #676 added two
entries to the same list and has since merged, so the conflict flagged on #669
is resolved here by keeping all three.
## Checklist
- [x] I did not hand-edit generated files under `src/app/api/`.
- [x] User-facing strings use translation keys — not applicable, no UI
change.
- [x] I added or updated tests appropriate to this change.
- [x] UI workflow changes include suitable e2e coverage, including
real-backend testing — this PR *is* that coverage.
- [x] Commits are signed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]