Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Feb 7, 2025
1 parent d57d78a commit 09d06bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/OptionsListUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,20 @@ describe('OptionsListUtils', () => {
expect(results.recentReports.length).toBe(Object.values(OPTIONS_WITH_WORKSPACE_ROOM.reports).length - 1);
});

describe('getShareLogOptions', () => {
it('should not include read-only report', () => {
// Given a list of 11 report options with reportID of 10 is archived
// OPTIONS, defined above

// When getting the share log options
const results = OptionsListUtils.getShareLogOptions(OPTIONS, []);

// Then the report with reportID of 10 should not be included on the list
expect(results.recentReports.length).toBe(10);
expect(results.recentReports.find((report) => report.reportID === '10')).toBeUndefined();
});
});

it('getMemberInviteOptions()', () => {
// When we only pass personal details
const results = OptionsListUtils.getMemberInviteOptions(OPTIONS.personalDetails, []);
Expand Down

0 comments on commit 09d06bd

Please sign in to comment.