You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WEB-1430: Fix the two Jest specs failing on dev - #4261
Two Jest specs have been failing on dev without anyone noticing. The Unit Tests (Jest) step runs with continue-on-error, so the check stays green; the latest dev run shows 2 failed, 303 passed. In both cases a later production change left the spec's test setup behind. The app code is fine, so this PR only touches the two specs.
With dev green, #3957 can remove continue-on-error and the Jest check will block merges again. Coverage reporting (#4249) also depends on that.
prepay-loan.component.spec.ts: WEB-657 made LoanAccountActionsBaseComponent build its navigation from route.pathFromRoot. The spec's route stub had no pathFromRoot, so after a contract termination the navigation threw and router.navigate was never called. The spec now uses the same :loanId/actions/:action route stub as the Working Capital prepay spec. It also asserts where the app goes (the loan's general tab, relative to the loans route, with productType) instead of only counting calls. A bare pathFromRoot: [] would pass even if the navigation went to the wrong URL.
There are no app source changes.
Verification:
Check
Result
The two specs and the sibling GSIM spec
3 suites, 16 of 16 tests pass
Full jest --ci
304 of 305 suites pass. The remaining one, pentaho.component.spec.ts ("decodes a report whose charset is quoted"), fails only under my local Homebrew Node 24.7 build, whose TextDecoder('windows-1252') maps 0x80 to U+0080 instead of €. It passes in dev's CI.
Put the base component's navigation back to ../../general
The updated prepay test fails, so it now guards the WEB-657 behaviour
Contract termination from the app (ng serve with proxy.localhost.conf.js) against Fineract develop (4a61d7c), on an active progressive loan
The form posts {transactionDate, externalId, note, dateFormat, locale} to /loans/2?command=contractTermination (the payload the spec asserts). Fineract returns 200 and sets the sub-status to contractTermination. The app lands on /#/clients/3/loans-accounts/2/general?productType=loan.
GSIM application with the charge shape the GSIM spec asserts, against the same Fineract
POST /savingsaccounts/gsim with two members returns 200 and creates one GSIM account. Both member accounts store the due date, fee day and fee interval as sent. GET /groups/{id}/gsimaccounts returns the new gsimId, which is the lookup submit() does through GroupsService.
Reviewing files that changed from the base of the PR and between 09b585d and b83739e.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Note
.coderabbit.yaml has unrecognized properties
CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
No actionable comments were generated in the recent review.
Walkthrough
Two specs update test setup. The prepay loan spec adds an action-route stub and checks the expected navigation target. The GSIM charges spec adds a GroupsService mock.
Changes
Prepay Loan Navigation Test
Layer / File(s)
Summary
Action route and navigation assertion src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.spec.ts
The spec uses an action-route stub with a parent route and pathFromRoot. It checks navigation to loan 1’s general tab relative to the parent, with the productType: 'loan' query parameter.
GSIM Charges Test Setup
Layer / File(s)
Summary
GroupsService test provider src/app/savings/gsim-account/create-gsim-account/create-gsim-account.charges.spec.ts
The spec imports GroupsService and adds an empty mock to the test providers.
The changes update test setup and navigation coverage. No actionable merge-blocking risk is established.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the ticket (WEB-1430) and says the change fixes two failing Jest specs on dev. The changeset only edits two spec files: the prepay-loan spec gets a route stub with pathFromRoot and a n…
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the ticket (WEB-1430) and says the change fixes two failing Jest specs on dev. The changeset only edits two spec files: the prepay-loan spec gets a route stub with pathFromRoot and a navigation assertion, and the GSIM charges spec gets a GroupsService mock. The title names the main purpose of the change and is specific enough for a teammate scanning history.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
- create-gsim-account.charges.spec.ts: provide GroupsService, which the
component injects since WEB-1388.
- prepay-loan.component.spec.ts: stub the :loanId/actions/:action route
with pathFromRoot, which the base component navigates from since
WEB-657, and assert the loan general tab it lands on.
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
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.
Description
Two Jest specs have been failing on
devwithout anyone noticing. The Unit Tests (Jest) step runs withcontinue-on-error, so the check stays green; the latestdevrun shows 2 failed, 303 passed. In both cases a later production change left the spec's test setup behind. The app code is fine, so this PR only touches the two specs.With
devgreen, #3957 can removecontinue-on-errorand the Jest check will block merges again. Coverage reporting (#4249) also depends on that.What changes:
create-gsim-account.charges.spec.ts: WEB-1388 (WEB-1388: Create one GSIM account per GSIM application and open it after submitting #4211) madeCreateGsimAccountComponentinjectGroupsService. This spec, added by WEB-1390 (WEB-1390: Send the charge dates of a GSIM application #4213) seven minutes earlier, never provided it, so every run failed withNG0201: No provider found for HttpClient. It now provides aGroupsServicestub, as the siblingcreate-gsim-account.component.spec.tsdoes. Onlysubmit()uses that service, and building the request bodies never calls it.prepay-loan.component.spec.ts: WEB-657 madeLoanAccountActionsBaseComponentbuild its navigation fromroute.pathFromRoot. The spec's route stub had nopathFromRoot, so after a contract termination the navigation threw androuter.navigatewas never called. The spec now uses the same:loanId/actions/:actionroute stub as the Working Capital prepay spec. It also asserts where the app goes (the loan's general tab, relative to the loans route, withproductType) instead of only counting calls. A barepathFromRoot: []would pass even if the navigation went to the wrong URL.There are no app source changes.
Verification:
jest --cipentaho.component.spec.ts("decodes a report whose charset is quoted"), fails only under my local Homebrew Node 24.7 build, whoseTextDecoder('windows-1252')maps0x80to U+0080 instead of€. It passes indev's CI.../../generalng servewithproxy.localhost.conf.js) against Fineractdevelop(4a61d7c), on an active progressive loan{transactionDate, externalId, note, dateFormat, locale}to/loans/2?command=contractTermination(the payload the spec asserts). Fineract returns 200 and sets the sub-status tocontractTermination. The app lands on/#/clients/3/loans-accounts/2/general?productType=loan.POST /savingsaccounts/gsimwith two members returns 200 and creates one GSIM account. Both member accounts store the due date, fee day and fee interval as sent.GET /groups/{id}/gsimaccountsreturns the newgsimId, which is the lookupsubmit()does throughGroupsService.prettier --checkandeslinton both filesRelated issues and discussion
https://mifosforge.jira.com/browse/WEB-1430
pathFromRoot: []), so it will need a one-line rebase after this PR merges.Screenshots, if any
None. This PR only changes tests.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit