-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ jest.mock('../../src/libs/Permissions'); | |
|
||
const ONYXKEYS = { | ||
PERSONAL_DETAILS: 'personalDetails', | ||
CURRENTLY_VIEWED_REPORTID: 'currentlyViewedReportID', | ||
NVP_PRIORITY_MODE: 'nvp_priorityMode', | ||
SESSION: 'session', | ||
BETAS: 'betas', | ||
|
@@ -306,15 +305,14 @@ describe('Sidebar', () => { | |
...LHNTestUtils.getAdvancedFakeReport(...boolArr), | ||
policyID: policy.policyID, | ||
}; | ||
const sidebarLinks = LHNTestUtils.getDefaultRenderedSidebarLinks(); | ||
const sidebarLinks = LHNTestUtils.getDefaultRenderedSidebarLinks(report1.reportID.toString()); | ||
|
||
return waitForPromisesToResolve() | ||
|
||
// When Onyx is updated to contain that data and the sidebar re-renders | ||
.then(() => Onyx.multiSet({ | ||
[ONYXKEYS.BETAS]: betas, | ||
[ONYXKEYS.PERSONAL_DETAILS]: LHNTestUtils.fakePersonalDetails, | ||
[ONYXKEYS.CURRENTLY_VIEWED_REPORTID]: report1.reportID.toString(), | ||
[`${ONYXKEYS.COLLECTION.REPORT}${report1.reportID}`]: report1, | ||
[`${ONYXKEYS.COLLECTION.REPORT}${report2.reportID}`]: report2, | ||
[`${ONYXKEYS.COLLECTION.POLICY}${policy.policyID}`]: policy, | ||
|
@@ -340,8 +338,6 @@ describe('Sidebar', () => { | |
|
||
describe('in #focus mode', () => { | ||
it('hides unread chats', () => { | ||
const sidebarLinks = LHNTestUtils.getDefaultRenderedSidebarLinks(); | ||
|
||
// Given the sidebar is rendered in #focus mode (hides read chats) | ||
// with report 1 and 2 having unread actions | ||
const report1 = { | ||
|
@@ -353,14 +349,14 @@ describe('Sidebar', () => { | |
lastReadSequenceNumber: LHNTestUtils.TEST_MAX_SEQUENCE_NUMBER - 1, | ||
}; | ||
const report3 = LHNTestUtils.getFakeReport(['[email protected]', '[email protected]']); | ||
let sidebarLinks = LHNTestUtils.getDefaultRenderedSidebarLinks(report1.reportID.toString()); | ||
|
||
return waitForPromisesToResolve() | ||
|
||
// When Onyx is updated to contain that data and the sidebar re-renders | ||
.then(() => Onyx.multiSet({ | ||
[ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, | ||
[ONYXKEYS.PERSONAL_DETAILS]: LHNTestUtils.fakePersonalDetails, | ||
[ONYXKEYS.CURRENTLY_VIEWED_REPORTID]: report1.reportID.toString(), | ||
[`${ONYXKEYS.COLLECTION.REPORT}${report1.reportID}`]: report1, | ||
[`${ONYXKEYS.COLLECTION.REPORT}${report2.reportID}`]: report2, | ||
[`${ONYXKEYS.COLLECTION.REPORT}${report3.reportID}`]: report3, | ||
|
@@ -391,7 +387,10 @@ describe('Sidebar', () => { | |
}) | ||
|
||
// When report 2 becomes the active report | ||
.then(() => Onyx.merge(ONYXKEYS.CURRENTLY_VIEWED_REPORTID, report2.reportID.toString())) | ||
.then(() => { | ||
sidebarLinks = LHNTestUtils.getDefaultRenderedSidebarLinks(report2.reportID.toString()); | ||
return waitForPromisesToResolve(); | ||
}) | ||
|
||
// Then report 1 should now disappear | ||
.then(() => { | ||
|
Oops, something went wrong.