Skip to content

Commit

Permalink
test: 40% coverage of my-view-advance-request page (#2495)
Browse files Browse the repository at this point in the history
* test: 40% coverage of my-view-advance-request page

* minor

* test: 100% coverage of my-view-adv-request page (#2496)

* test: 100% coverage of my-view-adv-request page

* minor
  • Loading branch information
suyashpatil78 authored Oct 10, 2023
1 parent e7f13e4 commit d510a21
Show file tree
Hide file tree
Showing 5 changed files with 405 additions and 18 deletions.
41 changes: 41 additions & 0 deletions src/app/core/mock-data/modal-controller.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,3 +513,44 @@ export const modalControllerParams7 = {
breakpoints: [0, 1],
handle: false,
};

export const popoverControllerParams8 = {
component: FyPopoverComponent,
componentProps: {
title: 'Pull Back Advance?',
formLabel: 'Pulling back your advance request will allow you to edit and re-submit the request.',
},
cssClass: 'fy-dialog-popover',
};

export const modalControllerParams8 = {
component: ViewCommentComponent,
componentProps: {
objectType: 'advance_requests',
objectId: 'areqoVuT5I8OOy',
},
cssClass: 'fy-modal',
showBackdrop: true,
canDismiss: true,
backdropDismiss: true,
animated: true,
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
};

export const modalControllerParams9 = {
component: FyViewAttachmentComponent,
componentProps: {
attachments: fileObject4[0],
},
mode: 'ios' as Mode,
cssClass: 'fy-modal',
showBackdrop: true,
canDismiss: true,
backdropDismiss: true,
animated: true,
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
};
4 changes: 2 additions & 2 deletions src/app/core/services/advance-request.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ describe('AdvanceRequestService', () => {
});
});

it('pullBackadvanceRequest(): should pull back an advance requests', (done) => {
it('pullBackAdvanceRequest(): should pull back an advance requests', (done) => {
apiService.post.and.returnValue(of(pullBackAdvancedRequests));

const payloadParam = {
Expand All @@ -372,7 +372,7 @@ describe('AdvanceRequestService', () => {

const advanceID = 'areqMP09oaYXBf';

advanceRequestService.pullBackadvanceRequest(advanceID, payloadParam).subscribe((res) => {
advanceRequestService.pullBackAdvanceRequest(advanceID, payloadParam).subscribe((res) => {
expect(res).toEqual(pullBackAdvancedRequests);
expect(apiService.post).toHaveBeenCalledOnceWith(`/advance_requests/${advanceID}/pull_back`, payloadParam);
done();
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/advance-request.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class AdvanceRequestService {
@CacheBuster({
cacheBusterNotifier: advanceRequestsCacheBuster$,
})
pullBackadvanceRequest(advanceRequestId: string, addStatusPayload: StatusPayload): Observable<AdvanceRequests> {
pullBackAdvanceRequest(advanceRequestId: string, addStatusPayload: StatusPayload): Observable<AdvanceRequests> {
return this.apiService.post('/advance_requests/' + advanceRequestId + '/pull_back', addStatusPayload);
}

Expand Down
Loading

0 comments on commit d510a21

Please sign in to comment.