From f9c89f26a290a5d89a80463e9ff9a914e4165162 Mon Sep 17 00:00:00 2001 From: SahilK-027 Date: Wed, 11 Dec 2024 15:57:42 +0530 Subject: [PATCH 1/3] fea: Add expenses to report (display exact amount) --- .../add-expenses-to-report.component.html | 6 ++++-- .../add-expenses-to-report.component.scss | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.html b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.html index 4d1afaac6f..aceca01f89 100644 --- a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.html +++ b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.html @@ -5,8 +5,10 @@
Add Expenses
- {{ selectedElements?.length }} {{ selectedElements?.length > 1 ? 'Expenses' : 'Expense' }} - - {{ selectedTotalAmount || 0 | humanizeCurrency : homeCurrency }} + {{ selectedElements?.length }} {{ selectedElements?.length > 1 ? 'Expenses' : 'Expense' }} +
+
+ {{ { value: selectedTotalAmount || 0, currencyCode: homeCurrency } | exactCurrency }}
diff --git a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.scss b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.scss index aa08f632b9..f5d7ea983a 100644 --- a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.scss +++ b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.scss @@ -7,14 +7,18 @@ } &--title-container { - color: $black; + color: $blue-black; font-weight: 500; - margin-left: -10%; } &--title { - font-size: 20px; - line-height: 26px; + font-size: 14px; + margin-bottom: 4px; + } + + &--total-amount { + font-size: 12px; + font-weight: 400; } &--close { From 4abf9734f61c4565f6c02bea786e003af7308a77 Mon Sep 17 00:00:00 2001 From: SahilK-027 Date: Wed, 11 Dec 2024 16:16:34 +0530 Subject: [PATCH 2/3] fix tests --- .../add-expenses-to-report.component.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts index 9a0d19a7cb..08e05d34e8 100644 --- a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts +++ b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts @@ -8,6 +8,7 @@ import { click, getElementBySelector, getTextContent } from 'src/app/core/dom-he import { CurrencyService } from 'src/app/core/services/currency.service'; import { FyCurrencyPipe } from 'src/app/shared/pipes/fy-currency.pipe'; import { HumanizeCurrencyPipe } from 'src/app/shared/pipes/humanize-currency.pipe'; +import { ExactCurrencyPipe } from 'src/app/shared/pipes/exact-currency.pipe'; import { AddExpensesToReportComponent } from './add-expenses-to-report.component'; import { expenseData } from 'src/app/core/mock-data/platform/v1/expense.data'; @@ -28,7 +29,7 @@ describe('AddExpensesToReportComponent', () => { const routerSpy = jasmine.createSpyObj('Router', ['navigate']); TestBed.configureTestingModule({ - declarations: [AddExpensesToReportComponent, HumanizeCurrencyPipe], + declarations: [AddExpensesToReportComponent, HumanizeCurrencyPipe, ExactCurrencyPipe], imports: [IonicModule.forRoot()], providers: [ FyCurrencyPipe, From fb241ed6d389f5b57aa294011f8d9f929a6ba607 Mon Sep 17 00:00:00 2001 From: SahilK-027 Date: Wed, 11 Dec 2024 16:41:22 +0530 Subject: [PATCH 3/3] fix tests --- .../add-expenses-to-report.component.spec.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts index 08e05d34e8..48ab48325e 100644 --- a/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts +++ b/src/app/fyle/my-view-report/add-expenses-to-report/add-expenses-to-report.component.spec.ts @@ -195,13 +195,18 @@ describe('AddExpensesToReportComponent', () => { expect(getTextContent(getElementBySelector(fixture, '.report-list--title'))).toEqual('Add Expenses'); }); - it('should show number of expenses and total amount', () => { + it('should show number of expenses', () => { component.selectedElements = [expense1, expense2]; fixture.detectChanges(); - expect(getTextContent(getElementBySelector(fixture, '.add-expenses-to-report--title'))).toEqual( - '2 Expenses - $500.00' - ); + expect(getTextContent(getElementBySelector(fixture, '.add-expenses-to-report--title'))).toEqual('2 Expenses'); + }); + + it('should show total amount', () => { + component.selectedElements = [expense1, expense2]; + fixture.detectChanges(); + + expect(getTextContent(getElementBySelector(fixture, '.add-expenses-to-report--total-amount'))).toEqual('$500.00'); }); it('should zero state message if no unreported expense exist', () => {