Skip to content

Commit

Permalink
Fixed incorrect wording on search for completed
Browse files Browse the repository at this point in the history
  • Loading branch information
RLCorp committed Sep 23, 2024
1 parent 8fc20a2 commit 6c56dfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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 @@ -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 6c56dfa

Please sign in to comment.