Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Mar 3, 2024
1 parent 8432fa6 commit d281421
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/LHNOptionsList/OptionRowLHN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
numberOfLines={1}
accessibilityLabel={translate('accessibilityHints.lastChatMessagePreview')}
>
{optionItem.alternateText}
{`${optionItem.alternateText}\u200B`}
</Text>
) : null}
</View>
Expand Down
10 changes: 4 additions & 6 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1382,12 +1382,10 @@ function formatReportLastMessageText(lastMessageText: string, isModifiedExpenseM
return String(lastMessageText).trim().replace(CONST.REGEX.LINE_BREAK, '').trim();
}
if (isAddComment) {
return (
String(lastMessageText)
.trim()
.replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, ' '.repeat(CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH))
.substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH) + '\u200B'
);
return String(lastMessageText)
.trim()
.replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, ' '.repeat(CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH))
.substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH);
}
return String(lastMessageText).trim().replace(CONST.REGEX.LINE_BREAK, ' ').substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH).trim();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/UnreadIndicatorsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ describe('Unread Indicators', () => {
const hintText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview');
const alternateText = screen.queryAllByLabelText(hintText);
expect(alternateText).toHaveLength(1);
expect(alternateText[0].props.children).toBe('Current User Comment 1');
expect(alternateText[0].props.children).toBe('Current User Comment 1\u200B');

Report.deleteReportComment(REPORT_ID, lastReportAction);
return waitForBatchedUpdates();
Expand All @@ -627,7 +627,7 @@ describe('Unread Indicators', () => {
const hintText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview');
const alternateText = screen.queryAllByLabelText(hintText);
expect(alternateText).toHaveLength(1);
expect(alternateText[0].props.children).toBe('Comment 9');
expect(alternateText[0].props.children).toBe('Comment 9\u200B');
})
);
});
Expand Down

0 comments on commit d281421

Please sign in to comment.