Skip to content

Commit

Permalink
add unit tests for ReportUtils.getReportIDFromDeepLink
Browse files Browse the repository at this point in the history
  • Loading branch information
marcochavezf committed Mar 9, 2023
1 parent 388d6a0 commit 8fd7588
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/actions/ReportTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,4 +666,14 @@ describe('actions/Report', () => {
expect(resultAction.message[0].reactions).toHaveLength(0);
});
});

it('should get the correct reportID from a deep link', () => {
expect(ReportUtils.getReportIDFromDeepLink('new-expensify://r/75431276')).toBe('75431276');
expect(ReportUtils.getReportIDFromDeepLink('https://www.expensify.cash/r/75431276')).toBe('75431276');
expect(ReportUtils.getReportIDFromDeepLink('https://staging.new.expensify.com/r/75431276')).toBe('75431276');
expect(ReportUtils.getReportIDFromDeepLink('http://localhost/r/75431276')).toBe('75431276');
expect(ReportUtils.getReportIDFromDeepLink('http://localhost:8080/r/75431276')).toBe('75431276');
expect(ReportUtils.getReportIDFromDeepLink('https://staging.expensify.cash/r/75431276')).toBe('75431276');
expect(ReportUtils.getReportIDFromDeepLink('https://new.expensify.com/r/75431276')).toBe('75431276');
});
});

0 comments on commit 8fd7588

Please sign in to comment.