Skip to content

Commit

Permalink
fix: Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bistaastha committed Oct 16, 2023
1 parent 2601e3a commit 3d3995b
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 498 deletions.
97 changes: 4 additions & 93 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions src/app/core/mock-data/modal-controller.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { FyAddToReportModalComponent } from 'src/app/shared/components/fy-add-to
import { reportOptionsData } from './report-options.data';
import { expectedErpt } from './report-unflattened.data';
import { FyInputPopoverComponent } from 'src/app/shared/components/fy-input-popover/fy-input-popover.component';
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, fileObject4 } from './file-object.data';
Expand Down Expand Up @@ -374,25 +373,6 @@ export const popoverControllerParams3 = {
cssClass: 'fy-dialog-popover',
};

export const advanceRequestPolicyViolationParams = {
component: PolicyViolationDialogComponent,
componentProps: {
latestComment: 'latest comment',
violatedPolicyRules: ['rule1', 'rule2'],
policyViolationActionDescription:
'The expense will be flagged, employee will be alerted, expense will be made unreportable and expense amount will be capped to the amount limit.',
},
mode: 'ios' as Mode,
cssClass: 'fy-modal',
showBackdrop: true,
canDismiss: true,
backdropDismiss: true,
animated: true,
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
};

export const popoverControllerParams4 = {
component: PopupAlertComponent,
componentProps: {
Expand Down
59 changes: 0 additions & 59 deletions src/app/core/services/advance-request-policy.service.spec.ts

This file was deleted.

31 changes: 0 additions & 31 deletions src/app/core/services/advance-request-policy.service.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/app/core/services/advance-request.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import { apiAdvanceReqRes } from '../mock-data/stats-dimension-response.data';
import { AdvancesStates } from '../models/advances-states.model';
import { SortingDirection } from '../models/sorting-direction.model';
import { SortingParam } from '../models/sorting-param.model';
import { AdvanceRequestPolicyService } from './advance-request-policy.service';
import { AdvanceRequestService } from './advance-request.service';
import { ApiV2Service } from './api-v2.service';
import { ApiService } from './api.service';
Expand All @@ -62,7 +61,6 @@ describe('AdvanceRequestService', () => {
let apiService: jasmine.SpyObj<ApiService>;
let apiv2Service: jasmine.SpyObj<ApiV2Service>;
let authService: jasmine.SpyObj<AuthService>;
let advanceRequestPolicyService: jasmine.SpyObj<AdvanceRequestPolicyService>;
let dataTransformService: jasmine.SpyObj<DataTransformService>;
let dateService: DateService;
let fileService: jasmine.SpyObj<FileService>;
Expand All @@ -73,7 +71,6 @@ describe('AdvanceRequestService', () => {
const apiServiceSpy = jasmine.createSpyObj('ApiService', ['get', 'post', 'delete']);
const apiv2ServiceSpy = jasmine.createSpyObj('ApiV2Service', ['get']);
const authServiceSpy = jasmine.createSpyObj('AuthService', ['getEou']);
const advanceRequestPolicyServiceSpy = jasmine.createSpyObj('AdvanceRequestPolicyService', ['servicePost']);
const dataTransformServiceSpy = jasmine.createSpyObj('DataTransformService', ['unflatten']);
const fileServiceSpy = jasmine.createSpyObj('FileService', ['post']);
const orgUserSettingsServiceSpy = jasmine.createSpyObj('OrgUserSettingsService', ['get']);
Expand All @@ -95,10 +92,6 @@ describe('AdvanceRequestService', () => {
provide: AuthService,
useValue: authServiceSpy,
},
{
provide: AdvanceRequestPolicyService,
useValue: advanceRequestPolicyServiceSpy,
},
{
provide: DataTransformService,
useValue: dataTransformServiceSpy,
Expand All @@ -122,9 +115,6 @@ describe('AdvanceRequestService', () => {
apiService = TestBed.inject(ApiService) as jasmine.SpyObj<ApiService>;
apiv2Service = TestBed.inject(ApiV2Service) as jasmine.SpyObj<ApiV2Service>;
authService = TestBed.inject(AuthService) as jasmine.SpyObj<AuthService>;
advanceRequestPolicyService = TestBed.inject(
AdvanceRequestPolicyService
) as jasmine.SpyObj<AdvanceRequestPolicyService>;
dataTransformService = TestBed.inject(DataTransformService) as jasmine.SpyObj<DataTransformService>;
fileService = TestBed.inject(FileService) as jasmine.SpyObj<FileService>;
orgUserSettingsService = TestBed.inject(OrgUserSettingsService) as jasmine.SpyObj<OrgUserSettingsService>;
Expand Down Expand Up @@ -555,26 +545,6 @@ describe('AdvanceRequestService', () => {
});
});

it('testPolicy(): should test policy violations', (done) => {
const date = '2023-02-23T19:37:01.207Z';
orgUserSettingsService.get.and.returnValue(of(orgUserSettingsData));
advanceRequestPolicyService.servicePost.and.returnValue(of(checkPolicyData));
timezoneService.convertToUtc.and.returnValue(new Date(date));

advanceRequestService.testPolicy(checkPolicyAdvReqParam).subscribe((res) => {
expect(res).toEqual(checkPolicyData);
expect(timezoneService.convertToUtc).toHaveBeenCalledOnceWith(
checkPolicyAdvReqParam.created_at,
orgUserSettingsData.locale.offset
);
expect(advanceRequestPolicyService.servicePost).toHaveBeenCalledOnceWith(
'/policy_check/test',
checkPolicyAdvReqParam
);
done();
});
});

it('getTeamAdvanceRequestsCount(): should get team advance count', (done) => {
spyOn(advanceRequestService, 'getTeamAdvanceRequests').and.returnValue(of(teamAdvanceCountRes));

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 @@ -238,7 +238,7 @@ export class AdvanceRequestService {
);
}

getActions(advanceRequestId: string) {
getActions(advanceRequestId: string): Observable<AdvanceRequestActions> {
return this.apiService.get('/advance_requests/' + advanceRequestId + '/actions');
}

Expand Down
Loading

0 comments on commit 3d3995b

Please sign in to comment.