Skip to content

Commit

Permalink
adjust spacing for comment readability
Browse files Browse the repository at this point in the history
  • Loading branch information
OlimpiaZurek committed Nov 14, 2024
1 parent 114e455 commit 47e511f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion tests/ui/LHNItemsPresence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,21 @@ describe('SidebarLinksData', () => {
// When the SidebarLinks are rendered without a specified report ID.
LHNTestUtils.getDefaultRenderedSidebarLinks();
const report = createReport();

// And the Onyx state is initialized with a report.
await initializeState({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
});

// Then no other reports should be displayed in the sidebar.
expect(getOptionRows()).toHaveLength(0);

// When the SidebarLinks are rendered again with the current active report ID.
LHNTestUtils.getDefaultRenderedSidebarLinks(report.reportID);

// Then the active report should be displayed as part of LHN,
expect(getOptionRows()).toHaveLength(1);

// And the active report should be highlighted.
// TODO add the proper assertion for the highlighted report.
});
Expand All @@ -129,16 +134,20 @@ describe('SidebarLinksData', () => {
...createReport(false, [1, 2], 0),
writeCapability: CONST.REPORT.WRITE_CAPABILITIES.ALL,
};

// And Onyx state is initialized with a draft report.
await initializeState({
[`${ONYXKEYS.COLLECTION.REPORT}${draftReport.reportID}`]: draftReport,
});

await waitForBatchedUpdatesWithAct();

// And a draft message is added to the report.
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${draftReport.reportID}`, 'draft report message');

// Then the sidebar should display the draft report.
expect(getDisplayNames()).toHaveLength(1);

// And the draft icon should be shown, indicating there is unsent content.
expect(screen.getByTestId('Pencil Icon')).toBeOnTheScreen();
});
Expand All @@ -147,18 +156,22 @@ describe('SidebarLinksData', () => {
// When the SidebarLinks are rendered.
LHNTestUtils.getDefaultRenderedSidebarLinks();
const report = createReport(false);

// And the report is initialized in Onyx.
await initializeState({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
});

// Then the report should not appear in the sidebar as it is not pinned.
expect(getOptionRows()).toHaveLength(0);

await waitForBatchedUpdatesWithAct();

// When the report is marked as pinned.
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, {isPinned: true});

// Then the report should appear in the sidebar because it’s pinned.
expect(getOptionRows()).toHaveLength(1);

// TODO add the proper assertion for the pinned report.
});
});
Expand All @@ -168,10 +181,12 @@ describe('SidebarLinksData', () => {
// When the SidebarLinks are rendered.
LHNTestUtils.getDefaultRenderedSidebarLinks();
const report = LHNTestUtils.getFakeReport([]);

// And a report with no participants is initialized in Onyx.
await initializeState({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
});

// Then the report should not appear in the sidebar.
expect(getOptionRows()).toHaveLength(0);
});
Expand All @@ -180,10 +195,12 @@ describe('SidebarLinksData', () => {
// When the SidebarLinks are rendered.
LHNTestUtils.getDefaultRenderedSidebarLinks();
const report = LHNTestUtils.getFakeReport([1, 2], 0);

// And a report with no messages is initialized in Onyx
await initializeState({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
});

// Then the empty report should not appear in the sidebar.
expect(getOptionRows()).toHaveLength(0);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/UnreadIndicatorsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import waitForBatchedUpdates from '../utils/waitForBatchedUpdates';
import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct';

// We need a large timeout here as we are lazy loading React Navigation screens and this test is running against the entire mounted App
jest.setTimeout(30000);
jest.setTimeout(60000);

jest.mock('@react-navigation/native');
jest.mock('../../src/libs/Notification/LocalNotification');
Expand Down

0 comments on commit 47e511f

Please sign in to comment.