From 6732c9caf9ab0125f2f9f9dca41945f778c9f32f Mon Sep 17 00:00:00 2001 From: Arnab subedi <147511052+Arnabsubedi233@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:25:56 +0000 Subject: [PATCH 1/9] PO-2420 --- .../fines-con-consolidate-acc.component.html | 1 + .../fines-con-search-result.component.html | 18 ++++++++-- .../fines-con-search-result.component.spec.ts | 29 ++++++++++++++-- .../fines-con-search-result.component.ts | 34 ++++++++++++++++--- 4 files changed, 73 insertions(+), 9 deletions(-) diff --git a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html index 7cf9cf06fc..27db0ef949 100644 --- a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html +++ b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html @@ -67,6 +67,7 @@
+ Try adding more information + to your search +
} @else { -+ Check your search + and try again +
} diff --git a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.spec.ts b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.spec.ts index 34c3f655e5..afa5cd0a7d 100644 --- a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.spec.ts +++ b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.spec.ts @@ -226,8 +226,7 @@ describe('FinesConSearchResultComponent', () => { ]); }); - it('should log and not display results when more than 100 results are provided', () => { - const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); + it('should set tooManyResults state and not display table when more than 100 results are provided', () => { const defendantAccounts = Array.from({ length: 101 }, (_, index) => ({ defendant_account_id: index + 1, account_number: `ACC-${index + 1}`, @@ -240,7 +239,31 @@ describe('FinesConSearchResultComponent', () => { expect(component.tableData).toHaveLength(0); expect(component.defendantAccountsData).toHaveLength(0); expect(component.checksByAccountId).toEqual({}); - expect(logSpy).toHaveBeenCalledWith('more than 100 results'); + expect(component.invalidResultsState).toBe('tooManyResults'); + }); + + it('should set noResults state when no accounts are provided', () => { + component.defendantAccounts = []; + + expect(component.tableData).toHaveLength(0); + expect(component.defendantAccountsData).toHaveLength(0); + expect(component.checksByAccountId).toEqual({}); + expect(component.invalidResultsState).toBe('noResults'); + }); + + it('should set table state when result set is valid', () => { + component.defendantAccounts = FINES_CON_SEARCH_RESULT_DEFENDANT_ACCOUNTS_FORMATTING_MOCK; + + expect(component.tableData.length).toBeGreaterThan(0); + expect(component.invalidResultsState).toBe('none'); + }); + + it('should emit navigateToSearch when navigateBackToSearch is called', () => { + const navigateToSearchSpy = vi.spyOn(component.navigateToSearch, 'emit'); + + component.navigateBackToSearch(); + + expect(navigateToSearchSpy).toHaveBeenCalledTimes(1); }); it('should ignore stale in-flight response when a newer search is triggered', () => { diff --git a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts index 78c4cab4db..d316be2697 100644 --- a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts +++ b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts @@ -1,4 +1,13 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, Input, OnDestroy } from '@angular/core'; +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + EventEmitter, + Output, + inject, + Input, + OnDestroy, +} from '@angular/core'; import { CommonModule } from '@angular/common'; import { Router } from '@angular/router'; import { Subscription } from 'rxjs'; @@ -15,10 +24,11 @@ import { FinesConDefendant } from '../../types/fines-con-defendant.type'; import { FinesConStore } from '../../stores/fines-con.store'; import { IFinesConSearchResultAccountCheck } from './interfaces/fines-con-search-result-account-check.interface'; import { FinesConPayloadService } from '../../services/fines-con-payload.service'; +import { GovukBackLinkComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-back-link'; @Component({ selector: 'app-fines-con-search-result', - imports: [CommonModule, FinesConSearchResultDefendantTableWrapperComponent], + imports: [CommonModule, GovukBackLinkComponent, FinesConSearchResultDefendantTableWrapperComponent], templateUrl: './fines-con-search-result.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) @@ -35,10 +45,12 @@ export class FinesConSearchResultComponent implements OnDestroy { public tableData: IFinesConSearchResultDefendantTableWrapperTableData[] = []; public defendantAccountsData: IFinesConSearchResultDefendantAccount[] = []; public checksByAccountId: Record- Try adding more information + Try adding more information to your search
} @else {- Check your search + Check your search and try again
} diff --git a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts index fd2c1831d1..22857f52cd 100644 --- a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts +++ b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-search-result/fines-con-search-result.component.ts @@ -169,7 +169,8 @@ export class FinesConSearchResultComponent implements OnDestroy { /** * Navigates user back to Search tab in the consolidation flow. */ - public navigateBackToSearch(): void { + public navigateBackToSearch(event: Event): void { + event.preventDefault(); this.navigateToSearch.emit(); } From 385ab3e84107cccd90d292b67e7dbc3161a4c690 Mon Sep 17 00:00:00 2001 From: hmcts-jenkins-cnp <60659747+hmcts-jenkins-cnp[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:41:33 +0000 Subject: [PATCH 4/9] Bumping chart version/ fixing aliases --- charts/opal-frontend/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/opal-frontend/Chart.yaml b/charts/opal-frontend/Chart.yaml index b259fa7301..f972a695b8 100644 --- a/charts/opal-frontend/Chart.yaml +++ b/charts/opal-frontend/Chart.yaml @@ -3,7 +3,7 @@ appVersion: '1.0' description: A Helm chart for opal-frontend name: opal-frontend home: https://github.com/hmcts/opal-frontend/ -version: 0.0.305 +version: 0.0.306 maintainers: - name: HMCTS Opal team dependencies: From ceaff7ef80caffcde3ee0bf760e350e1cc9453d6 Mon Sep 17 00:00:00 2001 From: Arnab subedi <147511052+Arnabsubedi233@users.noreply.github.com> Date: Tue, 24 Mar 2026 10:56:46 +0000 Subject: [PATCH 5/9] fixing merge issues --- .../fines-con-consolidate-acc.component.html | 12 ++--- .../fines-con-search-result.component.html | 48 ++++++++++--------- .../fines-con-search-result.component.spec.ts | 2 +- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html index d3f0a1fe75..1c79ed1bf8 100644 --- a/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html +++ b/src/app/flows/fines/fines-con/consolidate-acc/fines-con-consolidate-acc/fines-con-consolidate-acc.component.html @@ -62,12 +62,12 @@- Try adding more information - to your search -
- } @else { -- Check your search - and try again -
++ Try adding more information + to your search +
+ } @else { ++ Check your search + and try again +
+ } } -} \ No newline at end of file +Try adding more information - to your search + to your search.
} @else {Check your search - and try again + and try again.
} } From b29c8bad40f13d766712e9a361eab7906c709afc Mon Sep 17 00:00:00 2001 From: jonathanDuffy