Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sidebar Tests #24531

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/unit/SidebarFilterTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ describe('Sidebar', () => {
.then(() =>
Onyx.multiSet({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
[ONYXKEYS.IS_LOADING_REPORT_DATA]: false,
}),
)

Expand All @@ -100,7 +101,7 @@ describe('Sidebar', () => {
it('includes an empty chat report if it has a draft', () => {
LHNTestUtils.getDefaultRenderedSidebarLinks();

// Given a new report
// Given a new report with a draft text
const report = {
...LHNTestUtils.getFakeReport([1, 2], 0),
hasDraft: true,
Expand All @@ -113,10 +114,11 @@ describe('Sidebar', () => {
Onyx.multiSet({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
[ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails,
[ONYXKEYS.IS_LOADING_REPORT_DATA]: false,
}),
)

// Then no reports are rendered in the LHN
// Then the report should be rendered in the LHN since it has a draft
.then(() => {
const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames');
const displayNames = screen.queryAllByLabelText(hintText);
Expand Down