diff --git a/src/containers/Groups/__tests__/GroupsListScreen.tsx b/src/containers/Groups/__tests__/GroupsListScreen.tsx index a8c7f56739..66203271f0 100644 --- a/src/containers/Groups/__tests__/GroupsListScreen.tsx +++ b/src/containers/Groups/__tests__/GroupsListScreen.tsx @@ -15,6 +15,7 @@ import { resetScrollGroups } from '../../../actions/swipe'; import { ACTIONS } from '../../../constants'; import { CREATE_COMMUNITY_UNAUTHENTICATED_FLOW, + JOIN_COMMUNITY_UNAUTHENTICATED_FLOW, JOIN_BY_CODE_FLOW, } from '../../../routes/constants'; import { @@ -194,6 +195,23 @@ describe('GroupsListScreen', () => { expect(navigatePush).toHaveBeenCalledWith(JOIN_BY_CODE_FLOW); expect(store.getActions()).toEqual([navigatePushResponse]); }); + + it('navigates to Upgrade Account Screen if not signed in', () => { + (useIsAnonymousUser as jest.Mock).mockReturnValue(true); + + const { getByTestId, store } = renderWithContext(, { + initialState: { + ...initialState, + }, + }); + + fireEvent.press(getByTestId('joinCommunity')); + + expect(navigatePush).toHaveBeenCalledWith( + JOIN_COMMUNITY_UNAUTHENTICATED_FLOW, + ); + expect(store.getActions()).toEqual([navigatePushResponse]); + }); }); describe('create community button press', () => {