Skip to content

Commit

Permalink
mes-9760-searchCompletedWordingUpdateFix (#1732)
Browse files Browse the repository at this point in the history
* Fixed incorrect wording on search for completed

* Fixed spacing line
  • Loading branch information
RLCorp committed Sep 23, 2024
1 parent 8fc20a2 commit e10a5b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ <h2 class="des-header-style-4" id="view-test-result-vehicle-details-title">Vehic
<data-row *ngIf="data.make || data.model" [value]="data.make + ' ' + data.model" [label]="'Make and Model'">
</data-row>

<data-row-custom [centredData]="true" [label]="'MOT Status'">
<data-row-custom
[shouldHaveSeperator]="data.motEvidenceProvided || vehicleDetails"
[centredData]="true"
[label]="'MOT Status'">
<div class="ion-no-padding" *ngIf="!(data?.motStatus)">
<ion-text class="mes-data">{{getNoMOTDataText()}}</ion-text>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit e10a5b9

Please sign in to comment.