From b109626ed2eee2c18c7dec18f5b51e4c3fe816af Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Fri, 6 Dec 2024 19:22:59 +0000 Subject: [PATCH 1/4] remove period from modified expense messages --- src/libs/ModifiedExpenseMessage.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index f5109cbea74b..2ad25f77c249 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -81,12 +81,12 @@ function getMessageLine(prefix: string, messageFragments: string[]): string { return messageFragments.reduce((acc, value, index) => { if (index === messageFragments.length - 1) { if (messageFragments.length === 1) { - return `${acc} ${value}.`; + return `${acc} ${value}`; } if (messageFragments.length === 2) { - return `${acc} ${Localize.translateLocal('common.and')} ${value}.`; + return `${acc} ${Localize.translateLocal('common.and')} ${value}`; } - return `${acc}, ${Localize.translateLocal('common.and')} ${value}.`; + return `${acc}, ${Localize.translateLocal('common.and')} ${value}`; } if (index === 0) { return `${acc} ${value}`; From 52432e48dce6c2af97beb18799e57edc298ce446 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Fri, 6 Dec 2024 19:49:33 +0000 Subject: [PATCH 2/4] update tests to match new format without period --- tests/unit/ModifiedExpenseMessageTest.ts | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index 63263d67a9b7..3c01c28332e5 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -19,7 +19,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `changed the amount to $18.00 (previously $12.55).`; + const expectedResult = `changed the amount to $18.00 (previously $12.55)`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -40,7 +40,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `set the amount to $18.00.`; + const expectedResult = `set the amount to $18.00`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -63,7 +63,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = 'changed the amount to $18.00 (previously $12.55).\nremoved the description (previously "this is for the shuttle").'; + const expectedResult = 'changed the amount to $18.00 (previously $12.55).\nremoved the description (previously "this is for the shuttle")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -88,7 +88,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = 'changed the amount to $18.00 (previously $12.55).\nset the category to "Benefits".\nremoved the description (previously "this is for the shuttle").'; + const expectedResult = 'changed the amount to $18.00 (previously $12.55).\nset the category to "Benefits".\nremoved the description (previously "this is for the shuttle")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -111,7 +111,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = 'changed the amount to $18.00 (previously $12.55) and the merchant to "Taco Bell" (previously "Big Belly").'; + const expectedResult = 'changed the amount to $18.00 (previously $12.55) and the merchant to "Taco Bell" (previously "Big Belly")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -139,7 +139,7 @@ describe('ModifiedExpenseMessage', () => { it('returns the correct text message', () => { const expectedResult = - 'changed the amount to $18.00 (previously $12.55) and the merchant to "Taco Bell" (previously "Big Belly").\nset the category to "Benefits".\nremoved the description (previously "this is for the shuttle").'; + 'changed the amount to $18.00 (previously $12.55) and the merchant to "Taco Bell" (previously "Big Belly").\nset the category to "Benefits".\nremoved the description (previously "this is for the shuttle")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -165,7 +165,7 @@ describe('ModifiedExpenseMessage', () => { it('returns the correct text message', () => { const expectedResult = - 'changed the amount to $18.00 (previously $12.55), the description to "I bought it on the way" (previously "from the business trip"), and the merchant to "Taco Bell" (previously "Big Belly").'; + 'changed the amount to $18.00 (previously $12.55), the description to "I bought it on the way" (previously "from the business trip"), and the merchant to "Taco Bell" (previously "Big Belly")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -203,7 +203,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `set the merchant to "KFC".`; + const expectedResult = `set the merchant to "KFC"`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -224,7 +224,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `removed the description (previously "minishore") and the merchant (previously "Big Belly").`; + const expectedResult = `removed the description (previously "minishore") and the merchant (previously "Big Belly")`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -247,7 +247,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `removed the description (previously "minishore"), the merchant (previously "Big Belly"), and the category (previously "Benefits").`; + const expectedResult = `removed the description (previously "minishore"), the merchant (previously "Big Belly"), and the category (previously "Benefits")`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -266,7 +266,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `set the merchant to "Big Belly".`; + const expectedResult = `set the merchant to "Big Belly"`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -287,7 +287,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `set the description to "minishore" and the merchant to "Big Belly".`; + const expectedResult = `set the description to "minishore" and the merchant to "Big Belly"`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -310,7 +310,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `set the description to "minishore", the merchant to "Big Belly", and the category to "Benefits".`; + const expectedResult = `set the description to "minishore", the merchant to "Big Belly", and the category to "Benefits"`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -329,7 +329,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = 'changed the date to 2023-12-27 (previously 2023-12-26).'; + const expectedResult = 'changed the date to 2023-12-27 (previously 2023-12-26)'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); From b5624f39fc052e21afac631cfc2a1354397d0fd2 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Fri, 6 Dec 2024 20:29:23 +0000 Subject: [PATCH 3/4] tests part 2 --- tests/unit/ModifiedExpenseMessageTest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index 3c01c28332e5..00e9a8922551 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -139,7 +139,7 @@ describe('ModifiedExpenseMessage', () => { it('returns the correct text message', () => { const expectedResult = - 'changed the amount to $18.00 (previously $12.55) and the merchant to "Taco Bell" (previously "Big Belly").\nset the category to "Benefits".\nremoved the description (previously "this is for the shuttle")'; + 'changed the amount to $18.00 (previously $12.55) and the merchant to "Taco Bell" (previously "Big Belly")\nset the category to "Benefits"\nremoved the description (previously "this is for the shuttle")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -184,7 +184,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = `removed the merchant (previously "Big Belly").`; + const expectedResult = `removed the merchant (previously "Big Belly")`; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); From aadcd5032c3ef044ff22eef65c67de8160d7218d Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Fri, 6 Dec 2024 22:17:33 +0000 Subject: [PATCH 4/4] tests part 3 --- tests/unit/ModifiedExpenseMessageTest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index 00e9a8922551..fbf9b121069b 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -63,7 +63,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = 'changed the amount to $18.00 (previously $12.55).\nremoved the description (previously "this is for the shuttle")'; + const expectedResult = 'changed the amount to $18.00 (previously $12.55)\nremoved the description (previously "this is for the shuttle")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction); @@ -88,7 +88,7 @@ describe('ModifiedExpenseMessage', () => { }; it('returns the correct text message', () => { - const expectedResult = 'changed the amount to $18.00 (previously $12.55).\nset the category to "Benefits".\nremoved the description (previously "this is for the shuttle")'; + const expectedResult = 'changed the amount to $18.00 (previously $12.55)\nset the category to "Benefits"\nremoved the description (previously "this is for the shuttle")'; const result = ModifiedExpenseMessage.getForReportAction(report.reportID, reportAction);