Skip to content

Commit

Permalink
Added test for JOIN_COMMUNITY_UNAUTHENTICATED_FLOW
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCabreraJr committed Jan 6, 2024
1 parent 98bb8ca commit d76bae0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/containers/Groups/__tests__/GroupsListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(<GroupsListScreen />, {
initialState: {
...initialState,
},
});

fireEvent.press(getByTestId('joinCommunity'));

expect(navigatePush).toHaveBeenCalledWith(
JOIN_COMMUNITY_UNAUTHENTICATED_FLOW,
);
expect(store.getActions()).toEqual([navigatePushResponse]);
});
});

describe('create community button press', () => {
Expand Down

0 comments on commit d76bae0

Please sign in to comment.