-
Notifications
You must be signed in to change notification settings - Fork 3k
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: app does not open admin room after onboarding #55654
Changes from 1 commit
a747e5f
c751d79
0ca1ee8
c8cf4f8
0949def
a0fd853
e30e233
eb648e6
b7c8c15
e2f6faa
0fce8a1
a631139
b2bbe6b
dce0d91
ac7016d
7e793ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -41,15 +41,15 @@ describe('navigateAfterOnboarding', () => { | |||||||
jest.clearAllMocks(); | ||||||||
}); | ||||||||
|
||||||||
it('should navigate to the admin room report if shouldOpenAdminRoom and has onboardingAdminsChatReportID', () => { | ||||||||
it('should navigate to the admin room report if onboardingAdminsChatReportID is provided', () => { | ||||||||
const navigate = jest.spyOn(Navigation, 'navigate'); | ||||||||
|
||||||||
navigateAfterOnboarding(false, true, undefined, undefined, ONBOARDING_ADMINS_CHAT_REPORT_ID, true); | ||||||||
navigateAfterOnboarding(false, true, undefined, undefined, ONBOARDING_ADMINS_CHAT_REPORT_ID); | ||||||||
expect(navigate).toHaveBeenCalledWith(ROUTES.REPORT_WITH_ID.getRoute(ONBOARDING_ADMINS_CHAT_REPORT_ID)); | ||||||||
}); | ||||||||
|
||||||||
it('should not navigate if shouldOpenAdminRoom is false', () => { | ||||||||
navigateAfterOnboarding(false, true, undefined, undefined, ONBOARDING_ADMINS_CHAT_REPORT_ID, false); | ||||||||
it('should not navigate if onboardingAdminsChatReportID is not provided', () => { | ||||||||
navigateAfterOnboarding(false, true, undefined, undefined); | ||||||||
expect(Navigation.navigate).not.toHaveBeenCalled(); | ||||||||
}); | ||||||||
|
||||||||
|
@@ -67,7 +67,7 @@ describe('navigateAfterOnboarding', () => { | |||||||
mockFindLastAccessedReport.mockReturnValue(lastAccessedReport); | ||||||||
mockShouldOpenOnAdminRoom.mockReturnValue(false); | ||||||||
|
||||||||
navigateAfterOnboarding(true, true, ONBOARDING_POLICY_ID, ACTIVE_WORKSPACE_ID, undefined, false); | ||||||||
navigateAfterOnboarding(true, true, ONBOARDING_POLICY_ID, ACTIVE_WORKSPACE_ID, ONBOARDING_ADMINS_CHAT_REPORT_ID); | ||||||||
expect(navigate).not.toHaveBeenCalled(); | ||||||||
}); | ||||||||
|
||||||||
|
@@ -76,7 +76,17 @@ describe('navigateAfterOnboarding', () => { | |||||||
mockFindLastAccessedReport.mockReturnValue(lastAccessedReport); | ||||||||
mockShouldOpenOnAdminRoom.mockReturnValue(false); | ||||||||
|
||||||||
navigateAfterOnboarding(true, true, ONBOARDING_POLICY_ID, ACTIVE_WORKSPACE_ID, undefined, false); | ||||||||
navigateAfterOnboarding(true, true, ONBOARDING_POLICY_ID, ACTIVE_WORKSPACE_ID, ONBOARDING_ADMINS_CHAT_REPORT_ID); | ||||||||
expect(Navigation.navigate).not.toHaveBeenCalled(); | ||||||||
}); | ||||||||
|
||||||||
it('should navigate to last accessed report if shouldOpenOnAdminRoom is true on small screens', () => { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case, we don't need to care shouldOpenOnAdminRoom and onboardingAdminsChatReportID param There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the
Not the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, got it |
||||||||
const navigate = jest.spyOn(Navigation, 'navigate'); | ||||||||
const lastAccessedReport = {reportID: REPORT_ID}; | ||||||||
mockFindLastAccessedReport.mockReturnValue(lastAccessedReport); | ||||||||
mockShouldOpenOnAdminRoom.mockReturnValue(true); | ||||||||
|
||||||||
navigateAfterOnboarding(true, true, ONBOARDING_POLICY_ID, ACTIVE_WORKSPACE_ID, ONBOARDING_ADMINS_CHAT_REPORT_ID); | ||||||||
expect(navigate).toHaveBeenCalledWith(ROUTES.REPORT_WITH_ID.getRoute(REPORT_ID)); | ||||||||
}); | ||||||||
}); | ||||||||
mkzie2 marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be "should navigate to last accessed report on small screens"