Skip to content

Commit

Permalink
test: 35% coverage of view-team-advance-request page (#2492)
Browse files Browse the repository at this point in the history
* test: 35% coverage of view-team-adv-req

* minor

* test: 66% coverage of view-team-adv-request page (#2493)

* test: 66% coverage of view-team-adv-request page

* coverage at 74

* minor

* minor

* test: 100% coverage of view-team-adv-request page: (#2494)
  • Loading branch information
suyashpatil78 authored Oct 10, 2023
1 parent 57802db commit e7f13e4
Show file tree
Hide file tree
Showing 6 changed files with 598 additions and 44 deletions.
9 changes: 9 additions & 0 deletions src/app/core/mock-data/file-object.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,12 @@ export const fileObject9: FileObject[] = [
fyle_sub_url: '/api/files/fiV1gXpyCcbU/download',
},
];

export const fileObject10: FileObject[] = [
{
...fileObjectAdv1,
url: 'mockdownloadurl.png',
type: 'pdf',
thumbnail: 'src/assets/images/pdf-receipt-placeholder.png',
},
];
71 changes: 70 additions & 1 deletion src/app/core/mock-data/modal-controller.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import { FyInputPopoverComponent } from 'src/app/shared/components/fy-input-popo
import { PolicyViolationDialogComponent } from 'src/app/fyle/add-edit-advance-request/policy-violation-dialog/policy-violation-dialog.component';
import { CaptureReceiptComponent } from 'src/app/shared/components/capture-receipt/capture-receipt.component';
import { FyViewAttachmentComponent } from 'src/app/shared/components/fy-view-attachment/fy-view-attachment.component';
import { advanceRequestFileUrlData2 } from './file-object.data';
import { advanceRequestFileUrlData2, fileObject4 } from './file-object.data';
import { ViewCommentComponent } from 'src/app/shared/components/comments-history/view-comment/view-comment.component';
import { FyPopoverComponent } from 'src/app/shared/components/fy-popover/fy-popover.component';

export const modalControllerParams = {
component: FyFiltersComponent,
Expand Down Expand Up @@ -444,3 +445,71 @@ export const modalControllerParams5 = {
breakpoints: [0, 1],
handle: false,
};

export const popoverControllerParams5 = {
component: PopupAlertComponent,
cssClass: 'pop-up-in-center',
componentProps: {
title: 'Review Advance',
message: 'Advance request by Abhishek Jain of amount $54 will be approved',
primaryCta: {
text: 'Approve',
action: 'approve',
},
secondaryCta: {
text: 'Cancel',
action: 'cancel',
},
},
};

export const popoverControllerParams6 = {
component: FyPopoverComponent,
cssClass: 'fy-dialog-popover',
componentProps: {
title: 'Send Back',
formLabel: 'Reason For Sending Back Advance',
},
};

export const popoverControllerParams7 = {
component: FyPopoverComponent,
cssClass: 'fy-dialog-popover',
componentProps: {
title: 'Reject',
formLabel: 'Please mention the reason for rejecting the advance request',
},
};

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

export const modalControllerParams7 = {
component: FyViewAttachmentComponent,
componentProps: {
attachments: fileObject4[0],
},
mode: 'ios' as Mode,
presentingElement: undefined,
cssClass: 'fy-modal',
showBackdrop: true,
canDismiss: true,
backdropDismiss: true,
animated: true,
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
};
8 changes: 8 additions & 0 deletions src/app/core/mock-data/popup.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ export const popupConfigData2: PopupConfig = {
text: 'Close',
},
};

export const popupConfigData3: PopupConfig = {
header: 'Confirm',
message: 'Are you sure you want to delete this Advance Request',
primaryCta: {
text: 'Delete Advance Request',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
slot="start"
[ngClass]="{'view-team-advance-request--header-btn-container__sm': isDeviceWidthSmall}"
>
<ion-button [routerLink]="['/','enterprise','team_advance']">
<ion-button (click)="goToTeamAdvances()">
<ion-icon class="fy-icon-close" src="../../../../assets/svg/fy-close.svg" slot="icon-only"></ion-icon>
</ion-button>
</ion-buttons>
Expand Down
Loading

0 comments on commit e7f13e4

Please sign in to comment.