Skip to content

Commit

Permalink
fix: add calculated values for mileage distance and amount (#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunaj5 authored Dec 23, 2024
1 parent cf9bce3 commit 88dbb2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/app/core/mock-data/transaction.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2628,6 +2628,8 @@ export const transformedExpensePayload: Partial<Expense> = deepFreezeStrict({
commute_details_id: undefined,
hotel_is_breakfast_provided: null,
file_ids: undefined,
mileage_calculated_distance: null,
mileage_calculated_amount: null,
});

export const splitExpenseTxn2: Transaction = deepFreeze({
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/services/platform/v1/spender/expenses.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ export class ExpensesService {
file_ids: transaction.file_ids,
report_id: transaction.report_id,
travel_classes: [],
mileage_calculated_distance: transaction.mileage_calculated_distance,
mileage_calculated_amount: transaction.mileage_calculated_amount,
};

if (
Expand Down
6 changes: 1 addition & 5 deletions src/app/fyle/view-team-report/view-team-report.page.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CurrencyPipe } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, EventEmitter } from '@angular/core';
import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing';
import { ComponentFixture, TestBed, fakeAsync, flush, tick, waitForAsync } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { By } from '@angular/platform-browser';
Expand Down Expand Up @@ -588,7 +588,6 @@ describe('ViewTeamReportPageV2', () => {
component.report$ = of(reportWithExpenses);
component.expenses$ = of(expenseResponseData);
launchDarklyService.getVariation.and.returnValue(of(true));
fixture.detectChanges();

component.approveReport();
tick(1000);
Expand Down Expand Up @@ -653,7 +652,6 @@ describe('ViewTeamReportPageV2', () => {

component.report$ = of(reportWithExpenses);
component.expenses$ = of(expenseResponseData);
fixture.detectChanges();

component.approveReport();
tick();
Expand All @@ -679,7 +677,6 @@ describe('ViewTeamReportPageV2', () => {

component.report$ = of(reportWithExpenses);
component.expenses$ = of(expenseResponseData);
fixture.detectChanges();

component.approveReport();
tick();
Expand All @@ -704,7 +701,6 @@ describe('ViewTeamReportPageV2', () => {

component.report$ = of(reportWithExpenses);
component.expenses$ = of(expenseResponseData);
fixture.detectChanges();

component.approveReport();
tick();
Expand Down

0 comments on commit 88dbb2c

Please sign in to comment.