From e10a5b953bd6f845c46a5941b175cbbb37d6fc45 Mon Sep 17 00:00:00 2001 From: Rhys Lewis <88314925+RLCorp@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:45:36 +0100 Subject: [PATCH] mes-9760-searchCompletedWordingUpdateFix (#1732) * Fixed incorrect wording on search for completed * Fixed spacing line --- .../__tests__/vehicle-details-card.spec.ts | 3 ++- .../vehicle-details-card/vehicle-details-card.html | 5 ++++- .../components/vehicle-details-card/vehicle-details-card.ts | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/pages/view-test-result/components/vehicle-details-card/__tests__/vehicle-details-card.spec.ts b/src/app/pages/view-test-result/components/vehicle-details-card/__tests__/vehicle-details-card.spec.ts index 7b2d2f06c..d764c2f42 100644 --- a/src/app/pages/view-test-result/components/vehicle-details-card/__tests__/vehicle-details-card.spec.ts +++ b/src/app/pages/view-test-result/components/vehicle-details-card/__tests__/vehicle-details-card.spec.ts @@ -548,8 +548,9 @@ describe('VehicleDetailsCardComponent', () => { }); describe('getNoMOTDataText', () => { - it('returns the correct text when registration number is available', () => { + it('returns the correct text when registration number is available and there are previously filtered VRNs', () => { spyOnProperty(component, 'registrationNumber').and.returnValue('ABC123'); + spyOn(component, 'getPreviousFilteredVRNs').and.returnValue(['XYZ789']); expect(component.getNoMOTDataText()).toEqual('Unable to determine MOT status for ABC123'); }); diff --git a/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.html b/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.html index f4bb9ce38..f5b725ed7 100644 --- a/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.html +++ b/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.html @@ -45,7 +45,10 @@

Vehic - +
{{getNoMOTDataText()}}
diff --git a/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.ts b/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.ts index 8e5b02657..b4a032edf 100644 --- a/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.ts +++ b/src/app/pages/view-test-result/components/vehicle-details-card/vehicle-details-card.ts @@ -307,12 +307,12 @@ export class VehicleDetailsCardComponent { * Get the text indicating the absence of MOT data. * * @returns {string} - The text indicating the absence of MOT data. Possible values are: - * - 'Unable to determine MOT status for {registrationNumber}' if a registration number is available. + * - 'Unable to determine MOT status for {registrationNumber}' if a registration number is available and there are previously filtered VRNs. * - 'Unable to determine MOT status' if there are previously filtered VRNs but no registration number. - * - 'No VRNs were checked for MOT' if there are no previously filtered VRNs and no registration number. + * - 'No VRNs were checked for MOT' if there are no previously filtered VRNs and a registration number. */ getNoMOTDataText(): string { - if (this.registrationNumber) { + if (this.registrationNumber && this.getPreviousFilteredVRNs().length > 0) { return 'Unable to determine MOT status for ' + this.registrationNumber; } else if (this.getPreviousFilteredVRNs().length > 0) { return 'Unable to determine MOT status';