Skip to content

Commit

Permalink
update function name to standard practice
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsetterfield committed Sep 19, 2024
1 parent 4e95f69 commit b4b7041
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('MotCardComponent', () => {
spyOn(component.networkState, 'getNetworkState').and.returnValue(ConnectionStatus.ONLINE);
component.data = { status: MotStatusCodes.VALID } as MotHistory;
component.status = '200';
expect(component.isCallWasSuccessful()).toEqual(true);
expect(component.isCallSuccessful()).toEqual(true);
});
it(
'should return false if status is not 200 or Already Saved, data.status is ' +
Expand All @@ -52,20 +52,20 @@ describe('MotCardComponent', () => {
spyOn(component.networkState, 'getNetworkState').and.returnValue(ConnectionStatus.ONLINE);
component.data = { status: MotStatusCodes.VALID } as MotHistory;
component.status = '100';
expect(component.isCallWasSuccessful()).toEqual(false);
expect(component.isCallSuccessful()).toEqual(false);
}
);
it('should return false if status is 200, data.status is ' + '"No details" and the app is online', () => {
spyOn(component.networkState, 'getNetworkState').and.returnValue(ConnectionStatus.ONLINE);
component.data = { status: MotStatusCodes.NO_DETAILS } as MotHistory;
component.status = '200';
expect(component.isCallWasSuccessful()).toBeFalsy();
expect(component.isCallSuccessful()).toBeFalsy();
});
it('should return false if status is 200, data.status is ' + 'not "No details" and the app is not online', () => {
spyOn(component.networkState, 'getNetworkState').and.returnValue(ConnectionStatus.OFFLINE);
component.data = { status: MotStatusCodes.NO_DETAILS } as MotHistory;
component.status = '200';
expect(component.isCallWasSuccessful()).toEqual(false);
expect(component.isCallSuccessful()).toEqual(false);
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="black-text" id="mot-details-successful" *ngIf="isCallWasSuccessful()">
<div class="black-text" id="mot-details-successful" *ngIf="isCallSuccessful()">
<ion-row>
<ion-col size="34"></ion-col>
<ion-col size="10">
Expand Down Expand Up @@ -34,7 +34,7 @@
[formGroup]="formGroup"
></alternate-mot-evidence>
</div>
<div class="black-text" id="mot-details-unsuccessful" *ngIf="!isCallWasSuccessful()">
<div class="black-text" id="mot-details-unsuccessful" *ngIf="!isCallSuccessful()">
<ion-row>
<ion-col size="34"></ion-col>
<ion-col size="9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class MotCardComponent {

constructor(public networkState: NetworkStateProvider) {}

isCallWasSuccessful(): boolean {
isCallSuccessful(): boolean {
return (
(+this.status === HttpStatusCodes.OK || this.status === 'Already Saved') &&
this?.data?.status !== MotStatusCodes.NO_DETAILS &&
Expand Down

0 comments on commit b4b7041

Please sign in to comment.