Skip to content

Commit

Permalink
add test function
Browse files Browse the repository at this point in the history
  • Loading branch information
cretadn22 committed Jul 10, 2024
1 parent ee0d2e2 commit d05a5fe
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/unit/SidebarFilterTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,4 +935,33 @@ xdescribe('Sidebar', () => {
});
});
});

describe('filter paycheck and bill report', () => {
const report1: Report = {
...LHNTestUtils.getFakeReport(),
type: CONST.REPORT.TYPE.PAYCHECK,
};
const report2: Report = {
...LHNTestUtils.getFakeReport(),
type: CONST.REPORT.TYPE.BILL,
};
const report3: Report = LHNTestUtils.getFakeReport();
LHNTestUtils.getDefaultRenderedSidebarLinks(report1.reportID);
const reportCollectionDataSet: ReportCollectionDataSet = {
[`${ONYXKEYS.COLLECTION.REPORT}${report1.reportID}`]: report1,
[`${ONYXKEYS.COLLECTION.REPORT}${report2.reportID}`]: report2,
[`${ONYXKEYS.COLLECTION.REPORT}${report3.reportID}`]: report3,
};
return (
waitForBatchedUpdates()
.then(() => Onyx.multiSet(reportCollectionDataSet))

// Then the reports 1 and 2 are hidden and 3 is not
.then(() => {
const hintText = Localize.translateLocal('accessibilityHints.navigatesToChat');
const optionRows = screen.queryAllByAccessibilityHint(hintText);
expect(optionRows).toHaveLength(1);
})
);
});
});

0 comments on commit d05a5fe

Please sign in to comment.